Skip to content

Instantly share code, notes, and snippets.

@miebach
Created October 7, 2011 11:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miebach/1270119 to your computer and use it in GitHub Desktop.
Save miebach/1270119 to your computer and use it in GitHub Desktop.
Testing MySQL connection and select DB with PHP
<?php
echo "Connecting to MySQL Server ... ";
mysql_connect(
"localhost",
"admin",
"pass123")
or die(mysql_error());
echo "[OK]<br />";
echo "Selecting Database ... ";
mysql_select_db (
"database123")
or die(mysql_error());
echo "[OK]<br />";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment