MySQL Forums
Forum List  »  PHP

Re: Need help connecting MySQL with PHP
Posted by: Barry Galbraith
Date: February 25, 2013 09:01PM

I don't know that you can "include" a file from a folder above the htdocs folder.

I put connect_db.php and require.php in the htdocs folder, changed require.php like this.
<?php
require ( 'connect_db.php' ) ;

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

Then open http://localhost/require.php and got the identity of the mysql server displayed.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: Need help connecting MySQL with PHP
February 25, 2013 09:01PM


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.