[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
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

last edited (April 15, 2006) by Undead_Zeus, Number of views: 2922, Current Rev: 3 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.