MySQL Forums
Forum List  »  PHP

Need help connecting MySQL with PHP
Posted by: Michal McCaskle
Date: February 25, 2013 05:24PM

I am teaching myself PHP & MySQL from two different books:
PHP & MySQL in easy steps and PHP/MySQL for Dummies.

I've learned most of the SQL commands but for some reason I can't get a connection or response when I try to link the html files to the database.

I have Abyss Web Server setup on my computer to develop my sites before publishing.

In Easy Steps says to create two files:

connect_db.php in the htdocs parent folder:

$dbc = mysqli_connect
( 'localhost' , 'mike' , 'easysteps' , 'site_db' )
OR die
( mysqli_connect_error() ) ;
mysqli_set_charset( $dbc , 'utf8' ) ;


require.php in the htdocs folder

require ( '../connect_db.php' ) ;

if( mysqli_ping( $dbc ) )
{ echo 'MySQL Server '.mysqli_get_server_info( $dbc ).' on '.mysqli_get_host_info( $dbc ) ; }

Now when I open it in my browser the page is empty. And nothing shows up....
There should be a line saying connection succesful but its not there.

And when I try PHP/MySQL for Dummies' SQL test i get the same blank page.

Any help would be greatly appreciated!!!!!

Options: ReplyQuote

Written By
Need help connecting MySQL with PHP
February 25, 2013 05:24PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.