Hi, I am a beginner at this and I am creating a shopping website. I want to display all my items, 3 per row going down the page, the code that i found is this:
$dbQuery="SELECT * from shoppingItems";
$display_columns = 3;
$result = mysql_query($dbQuery);
$count = mysql_numrows($result);
$dbRow=mysql_fetch_array($result);
$padding = ($display_columns-1)-(($count-1)%$display_columns);
echo '<table>';
// Let's begin our loop.
for($i=0; $i<$count; $i++)
{ // Whenever $i is a multiple of $display_columns (including 0),
// it's a sign that we're hitting the start of a new row.
if($i%$display_columns == 0)
echo '<tr>';
//Now for an item.
echo '<td>';
echo mysql_result($result,$i,'ID'); //Here is were I want to add in more fields, atm, only field 'ID' from my table is being displayed

echo '</td>';
//Whenever $i is one less than a multiple of $display_columns,
// it's a sign that we're hitting the end of the current row.
if($i%$display_columns == $display_columns-1)
echo '</tr>';
}
if($padding!=0)
{ for($i=0;$i<$padding;$i++)
echo '<td></td>';
echo '</tr>';
}
echo '</table>';
?>
at line 'echo mysql_result($result,$i,'ID');' I tried writing in echo mysql_result($result,$i,('ID','description','price'));
but this just caused an error.
I believe that it should be able to pass more than one field name in this function but i do not know how. Can anyone help?
thanks