Jump to content
Larry Ullman's Book Forums

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


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


  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...