robert1962
-
Posts
8 -
Joined
-
Last visited
Posts posted by robert1962
-
-
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.
-
The orders are processing, but the order_contents are not.
-
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.
-
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?
-
That was the problem, Larry. Thanks. Why does that happen when you use the 'run' function in notepad++?
-
Using apache on xampp so I'm going through localhost
-
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.
Chapter 4: Register.php
in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Posted
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.