To all, I am sorry the correct line is:
mysql_select_db($link,"database name")
If you are missing the database name you will get an error concerning undefined function.
jzf
J. Connolly wrote:
Mike,
There is no database sepcified in your code anywhere. The line:
$result = mysql_query($sql); does not specify which database you are connecting to either. You can specify the database in the line:
$link = mysql_connect($host,$user,$password,$database); //or in a separate line with the function
mysql_select_db("database name",$link) //where $link is the connection info above
And then use in the line:
$result = mysql_query($link, $sql); //this enable the query to find the connection and the code.
I hope this makes sense. I have only been doing this a couple of weeks. Some books have the ($link,$sql) order reversed which will also give you an error. IN ADDITION, if you are using mysqli you need to enter this ext in the PHP.ini file. I can only connect using mysqli and not mysql.
Good luck,
jzf
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php