Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created February 25, 2010 18:48
Show Gist options
  • Save mrchrisadams/314888 to your computer and use it in GitHub Desktop.
Save mrchrisadams/314888 to your computer and use it in GitHub Desktop.
<?php phpinfo() ; ?>
<?php
$connection_to_server = mysql_connect( '123.123.123.123', 'db_user_name', 'password') or die('Could not connect to mysql server.' );
mysql_select_db('database_name', $connection_to_server) or die('Could not select database.');
if ($connection_to_server) {
echo var_dump($connection_to_server);
$database_connection = mysql_select_db('database_name', $connection_to_server) or die('Could not select database.');
echo var_dump($database_connection);
} else {
echo 'no connection';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment