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:
<?php
$dbc = mysqli_connect
( 'localhost' , 'mike' , 'easysteps' , 'site_db' )
OR die
( mysqli_connect_error() ) ;
mysqli_set_charset( $dbc , 'utf8' ) ;
&
require.php in the htdocs folder
<?php
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!!!!!
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:
<?php
$dbc = mysqli_connect
( 'localhost' , 'mike' , 'easysteps' , 'site_db' )
OR die
( mysqli_connect_error() ) ;
mysqli_set_charset( $dbc , 'utf8' ) ;
&
require.php in the htdocs folder
<?php
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!!!!!