robert1962
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by robert1962
-
Chapter 4: Register.php
robert1962 replied to robert1962's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
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. -
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.
-
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.