Jump to content
Larry Ullman's Book Forums

Require_Once (Mysql) In Php 6 And Mysql 5 For Dynamic Web Sites


bharat
 Share

Recommended Posts

Dear Sir/Mam, I am learning

PHP 6 and MySQL 5 for Dynamic Web Sites in chapter 16 User Registration at register.php page, I found require_once (MYSQL); in line 10. But within ch16 folder there are no MySQL , and there is no extension like .php or .html. So I was thinking it is wrong or may be require_once (mysqli_connect);instead require_once (MYSQL); . Plz conform me.Regards, Bharat

Link to comment
Share on other sites

Larry uses a constant to facilitate connecting to the database. In the config file you need to define the constant MYSQL e.g.

define ('MYSQL', '../mysqli_connect.php');

The second parameter is the absolute path to your connection script. Then any file that needs to connect to the database simply calls the MYSQL constant

require_once(MYSQL);

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...