[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
PHPMysql
Here is a simple way to connect Php to Mysql
Further examples can be found at http://www.snippetcollection.com
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
PHPMysql
Here is a simple way to connect Php to Mysql
<?php
$DB_HOST = 'localhost'; // hostname
$DB_NAME = ''; // database name
$DB_USER = ''; // database username
$DB_PASS = ''; // database password*/
$dbh = mysql_pconnect ($DB_HOST, $DB_USER, $DB_PASS);
mysql_selectdb($DB_NAME);
$result = mysql_query("SELECT * FROM bookstable");
if(!$result) die("Query Failed.");
while($rowdata = mysql_fetch_row($result)) {
//print out the data
}
?>Further examples can be found at http://www.snippetcollection.com
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
