MySQL Forums
Forum List  »  PHP

Re: unable to connect to mysql on localhost, OS used WINDOWS XP
Posted by: Guruprasad Chube
Date: April 30, 2007 09:52PM

[client 127.0.0.1] PHP Fatal error: Call to undefined function mysql_connect() in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\createtable3.php on line 3



error message i receive while executing the code


<?php
//open the connection
$conn = mysql_connect ("localhost","root","gac");
//pick the database to use
mysql_select_db ("test" ,$conn);
//create the sql statement
$sql = "CREATE TABLE testtable (id int not null primary keyauto_increment,
testField varchar (75))";
//execute the SQL statement
$result = mysql_query($sql, $conn);
//echo the result identifier
echo $result;
?>

I am using OS windows XP


Regards

guruprasad

Options: ReplyQuote




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.