Skip to content

Instantly share code, notes, and snippets.

@cemerson
Created October 5, 2012 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerson/3839977 to your computer and use it in GitHub Desktop.
Save cemerson/3839977 to your computer and use it in GitHub Desktop.
PHP: Test Database Connection
<?php
// Test a database connection via PHP
$db = @mysql_connect('#SERVER_NAME#', '#DB_USER#', '#DB_PASSWORD#');
if (!$db) echo "connection failed";
else echo "connection succeeded";
define('DB_NAME', 'wp_situationalcom_dev');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment