<?php
$server_connect = @mysql_connect('localhost', 'root', '');
$database_select = @mysql_select_db('address_db');
//If server connection fails
if(!$server_connect){
echo 'Server connection Error!<br />';
}
//If database connection fails
if(!$database_select){
echo 'Database connection Error!';
}
?>
$server_connect = @mysql_connect('localhost', 'root', '');
$database_select = @mysql_select_db('address_db');
//If server connection fails
if(!$server_connect){
echo 'Server connection Error!<br />';
}
//If database connection fails
if(!$database_select){
echo 'Database connection Error!';
}
?>
Save it as connection.php. And run it through your localhost
No comments:
Post a Comment