I'm learning PHP
and I'm well versed with Java
and C
. I was given a practice assignment to create a shopping project. I need to pull out the products from my database. I'm using the product id to do this. I thought of using for loop but I can't access the prod_id
from the database as a condition to check! Can anybody help me?! I have done all the form handling but I need to output the products. This is the for
-loop I am using. Please let me know if I have to add any more info. Thanks in advance :)
for($i=1; $i + 1 < prod_id; $i++)
{
$query = "SELECT * FROM products where prod_id=$i";
}