MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Newbie to My Sql.... need some assistance
Posted by: Brenden Sanborn
Date: November 18, 2004 02:46PM

I wanted to post what I have for my connection code. On my index.php page, I have a header.inc and a connect.php which is the info below. I did many variations but am unsure if there needs to be anything special for just a local server setup. Thanks guys and gals.

- Brenden

<?
$cn = mysql_connect ("localhost", "root","mypassword") or die("Could not connect to server");
if(mysql_select_db ("my_database",$cn)==false) {die ("Could not connect to database");}
function SQLParse($str)
{
return stripslashes(str_replace("'","''",$str));
}

?>

Options: ReplyQuote


Subject
Written By
Posted
Re: Newbie to My Sql.... need some assistance
November 18, 2004 02:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.