Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
jcan18

Chapter 9/no Database Selected

Recommended Posts

I am having trouble getting script 9.3 to function properly. I have followed the directions and tried variations of the script to see if I could get it to work, all of which have failed. When I run script 9.2, I get the blank white page. I assume this means that the connection was established properly. However, when I run script 9.3 my output is as follows:

 

System Error

You could not be registered due to a system error. We apologize for any inconvenience.

No database selected

Query: insert into users (first_name, last_name, email, pass, registration_date) values ('Jake', 'Carrie', 'examp@yahoo.com', SHA1('apple'), NOW())

 

I still have not been able to resolve the issue, which is unfortunate because this script is needed for the rest of the chapter. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Do you have this line:

 

require ('../mysqli_connect.php'); // Connect to the db.

 
You should be able to echo out the value of $dbc to confirm that a connection exists. 

Share this post


Link to post
Share on other sites

I'm having the same problem.  I checked the mysql_connect.php path and it should be ok.  Is there  another way to check the db connection from the registration.php file or from another file?

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...
Sign in to follow this  

×
×
  • Create New...