Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Test php mysql pdo_mysql (See related posts)

// description of your code here

<?php $link = mysql_connect('localhost','mydbuser','mydbpassword');
if (!$link) {
        die('Could not connect to MySQL: ' . mysql_error());
} echo 'mySql Connection OK';
mysql_close($link);

$dbh = new PDO('mysql:host=localhost;dbname=test','mydbuser','mydbpassword');
if ($dbh) {
        echo 'mysql_pdo CONNECTION OK';
}
else {echo 'mysql_pdo ERROR';}
?>


Comments on this post

panxiaoming posts on Mar 17, 2008 at 06:10
adsfadfasdfaf
panxiaoming posts on Mar 17, 2008 at 06:10
GOOD MORNING:
EVERY BODY!

You need to create an account or log in to post comments to this site.