Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

robert1962's Achievements


Newbie (1/14)



  1. Thanks for the insight. Yes...there was an error in the code in $q, I accidently placed a single quote before username in the query which I didn't in the question I sent to you. Thanks very much.
  2. I'm getting an error that says parameter 1 of mysqli_num_rows($r) should be a mysqli_result, Boolean given. Here is the applicable code: $q = "SELECT email, username FROM users WHERE email='$e' OR username='$u'"; $r = mysqli_query($dbc,$q); $rows = mysqli_num_rows($r); //This is where the error occurs. Help would greatly be appreciated! Thank you.
  3. Hi. I'm having a problem with the code in checkout.php in Chapter 19. For some reason, I get the following errors: Notice: Undefined index: cart in C:\xampp\htdocs\php\PHPandMySQL\ch19\checkout.php on line 26. Warning: Invalid argument supplied for foreach() in C;\xampp\htdocs\php\PHPandMySQL\ch19\checkout.php on line 26. Notice: Undefined index: cart in C;\xampp\htdocs\php\PHPandMySQL\ch19\checkout.php on line 37. I have included the header.html file. This starts the session. So the session variable is set. Here is my code for the foreach function on line 26: foreach($_SESSION['cart'] as $pid => $item) { ... } Here is the if conditional for line 37: if($affected == count($_SESSION['cart'])) { ... } Why am I getting these notices and warnings? The code appears correct.
  4. Can't get the dates to show up when I call up forum.php. The code I downloaded from your site doesn't work either. Could it be that the variables $first and $last are local to the if?
  5. That was the problem, Larry. Thanks. Why does that happen when you use the 'run' function in notepad++?
  6. I have coded script 3.2 and 3.3, but when I attempt to submit the form the php in handle_form.php gets commented out. I attempted to use your code as well and had the same problem. Please help.
  • Create New...