Hi,
You need to create a connection to the MySQL server and select the database which gives you a connection resource. Even though it is possible to call mysql_query without the connection variable, it is best to include that connection resource as a parameter to the mysql_query:
$result = mysql_query("SELECT * FROM cinemahall", $my_db_connection);
You should also include error handling in your code, at least the following:
$result = mysql_query("SELECT * FROM cinemahall", $my_db_connection) or die ("Could not execute query: <br>\n" . mysql_errno() . ": " . mysql_error() . "<br>\n"
;
Error handling should also be part of the functions mysql_connect() and mysql_select_db(). That is the only way to get to see the first error message.
Regards,
toivo
Sydney, Australia
Edited 1 time(s). Last edit at 03/28/2008 11:34PM by toivo.