Simple php queries the database statement instance code. This tutorial is helpful for beginners. we talk about database connection and use the mysql tutorial _ query, mysql_num_rows, and mysql_fetch_row functions to read and output records. Html this tutorial is helpful for beginners. we have introduced the database tutorial connection and used the mysql tutorial _ query, mysql_num_rows, and mysql_fetch_row functions to read and output records.
Selecting Data
$ User = "root ";
$ Pass = "";
$ Db = "mydatabase ";
$ Link = mysql_connect ("localhost", $ user, $ pass );
If (! $ Link ){
Die ("Couldn't connect to MySQL:". mysql_error ());
}
Mysql_select_db ($ db, $ link) or die ("Couldn't open $ db:". mysql_error ());
$ Result = mysql_query ("SELECT * FROM domains where sex = 'F '");
$ Num_rows = mysql_num_rows ($ result );
Print"
$ Num_rows www.zhutiai.com women have added data to the table
N ";
Print"
";While ($ a_row = mysql_fetch_row ($ result )){Print"
";Foreach ($ a_row as $ field ){Print"
| ". Strips tutorial lashes ($ field )." | ";}Print"
";}Print"
";
Mysql_close ($ link );
?>
Bytes. Html...