What's wrong with that?
The connection has been shown to be successful, but the error is reported.
Connect to the database successfully!
Warning: F:\environment\WAMP\wamp5\wamp\wamp\www\test\sql.php
Warning: F:\environment\WAMP\wamp5\wamp\wamp\www\test\sql.php
Reply to discussion (solution)
$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());
$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());
The Web page shows the No database selected, this is not found this databases?
But I'm using the Navicat 8 for MySQL view tool.
I am here to create the database and resume the table. How should I query the tables in this database?
You only connected to the database system, but did not select the database to operate
mysql_select_db (' Library name ');
How else do you know that you are querying the user table in that library?
In addition, your mysql_close ($conn) is in the function, and the $conn is not passed to the function.
So there's going to be a 2nd mistake.
The moderator answers the perfect
$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());
The Web page shows the No database selected, this is not found this databases?
But I'm using the Navicat 8 for MySQL view tool.
I am here to create the database and resume the table. How should I query the tables in this database?
You don't have mysql_select_db,mysql before mysql_query. You do not know which db you need to perform the query operation.
After creating the connection, add a sentence
@mysql_select_db (' Fill in database name ' here, $conn) or Die (Mysql_error ());