This is a PHP getting Started tutorial, is about the PHP connection database and display the desired data oh, that is, a simple php+mysql database on the Web page application example.
This is an introductory tutorial on PHP tutorial, it is about the PHP Connection Database tutorial and display the data you want, that is, a simple php+mysql tutorial database on the Web page application example.
$Host = "localhost";
$MySQL _username= "root";
$MySQL _userpass= "Password";
$MySQL _database= "DB";
$Query = "SELECT * from Domain";
if (!mysql_connect ($Host, $MySQL _username, $MySQL _userpass)) {
Print "Cannot connect to MySQL:". Mysql_error ();
Exit
}
if (!mysql_select_db ($MySQL _database)) {
Print "Cannot select DB
";
Exit
}
if (! $Result _id=mysql_query ($Query)) {
Print "Query Error:". Mysql_error ();
Exit
}
while ($Result =mysql_fetch_row ($Result _id)) {
Print "------------------
";
print "$Result [0]
";
Print "$Result [1]
";
Print "$Result [2]
";
Print "$Result [3]
";
Print "-------------------
";
}?>
http://www.bkjia.com/PHPjc/630869.html www.bkjia.com true http://www.bkjia.com/PHPjc/630869.html techarticle This is a PHP getting Started tutorial, is about the PHP connection database and display the desired data oh, that is, a simple php+mysql database on the Web page application example. This is an article ...