Jump to content
Larry Ullman's Book Forums
bharat

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

Share this post


Link to post
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

Share this post


Link to post
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.

Guest
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.

Loading...

×
×
  • Create New...