Php sql results question for the query
Posted: Thu May 07, 2009 9:50 am
Hello.I have a $SESSION['card'];
with some values example 6,5,45,2,5 all that are id's of products
What i want is to echo the rest things that describes products ids like name descreption etc
until here its working fine
but the query
$strquery = mysql_query("SELECT * FROM products WHERE prod_id=$pieces[0]");
in the spot prod_id i want it to take alla the id's from the array
thnx '
with some values example 6,5,45,2,5 all that are id's of products
What i want is to echo the rest things that describes products ids like name descreption etc
Code: Select all
//the connection to database
include('includes/conn.inc.php');
//iBrake the string to an array
$pieces = explode(",", $_SESSION['card']);
$strquery = mysql_query("SELECT * FROM products WHERE prod_id=$pieces[0]");
while($row = mysql_fetch_array($strquery))
{
extract($row);
echo "<table>";
echo "<tr>";
echo "<td>";
echo $row['prod_name'];
echo "</td>";
echo "</tr>";
echo "</table>";
}
but the query
$strquery = mysql_query("SELECT * FROM products WHERE prod_id=$pieces[0]");
in the spot prod_id i want it to take alla the id's from the array
thnx '