This tutorial is helpful for beginners, we spoke the database tutorial connection and used the MySQL tutorial _query,mysql_num_rows,mysql_fetch_row three functions to read and output a record.
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 has 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);
?>
http://www.bkjia.com/PHPjc/630747.html www.bkjia.com true http://www.bkjia.com/PHPjc/630747.html techarticle This tutorial is helpful for beginners, we spoke the database tutorial connection and used the MySQL tutorial _query,mysql_num_rows,mysql_fetch_row three functions to read and output a record. HTML ...