PHP queries the complete MySQL database code. PHP queries the complete MySQL database code. when using this code, you must modify the user name and password in the connection statement .? Php $ linkmysql_connect (localhost, root, 123456) alert: ask PHP to query the complete MySQL database code. when using this code, change the user name and password in the connection statement.
$ Link = mysql_connect ('localhost', 'root', '000000') // the following prompt is displayed: change the user name and password first.
Or die ('could not connect: '. mysql_error ());
Mysql_select_db ('ruida ') or die ('could not select database ');
// Execute SQL query
$ Query = 'select * FROM product ';
$ Result = mysql_query ($ query) or die ('query failed: '. mysql_error ());
// Display the result in HTML
Echo"
\ N ";While ($ line = mysql_fetch_assoc ($ result )){Echo "\ t
\ N ";Foreach ($ line as $ col_value ){Echo "\ t
$ Col_value | \ N ";}Echo "\ t
\ N ";}Echo"
\ N ";
// Release the result set
Mysql_free_result ($ result );
// Close the connection to Liehuo. Org
Mysql_close ($ link );
?>
The http://www.bkjia.com/PHPjc/364555.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/364555.htmlTechArticlePHP queries the complete code for the MySQL database, so be sure to modify the user name and password in the connection statement when using it. ? Php $ link = mysql_connect ('localhost', 'root', '000000') // alert: please...