![]() |
Grabbing IDs from Database
Hey
I'm creating a simple shopping cart but I'm stuck trying to figure out why I'm not getting the output I'm looking for. PHP Code:
Here is the front side: PHP Code:
Can anyone lend a hand please? |
First off you are not doing this correctly, you should never leave this sort of processing to the script. Make your query
sql Code:
$product_id = $_REQUEST['id']; to $product_id = (int)$_REQUEST['id']; to prevent SQL injection. If it returns a row it exists, if there are no rows it does not. I would strongly suggest putting anything as complicated as a shopping cart aside to learn SQL. |
Got it. Thank you, I've added the (int).
PHP Code:
|
Quote:
Quote:
|
So this is what I thought of but its returning false on anything bigger than 1
PHP Code:
|
Quote:
|
| All times are GMT. The time now is 11:47 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0