Dudes, thank you so much for all your help. I have asked an insane number of dumb/obvious questions and everyone has been 100% helpful. In that spirit, here's another goofy Q:
I nab all the results from a table based on a condition. No problem:
$query_lots="SELECT * FROM lots_new WHERE lot_sku_id='$curr_key'";
$lots_result=mysql_query($query_lots) or die(mysql_error());
Now, that $lots_result could hold between 1 and maybe 5 rows. To find out, I count:
$num_lots=mysql_num_rows($lots_result);
Okay, so 1,2,3 rows, whatever. Here's the problem- These results are displayed in a table. IF there's just one record, then we display those results at the END of the first row of the table:
Item ItemDesc Lot LotQTY
Wh Desc 5 15
However, if there are TWO or MORE results, we need to create a new row for them:
Item ItemDesc Lot LotQTY
Wh Desc 5 15
6 10 '
So, I wrote some code:
while($lots_row=mysql_fetch_array($lots_result)){
echo "<td class='boltd'>$lots_row[lot] </td> <td class='boltd'>$lots_row[lot_qty] $bol_row[sau]</td>
</tr>";
if($num_lots > 1){
echo "<tr class'hint'><td class='boltd'> </td> <td class='boltd'> </td> <td class='boltd'>$lots_row[lot] </td> <td class='boltd'>$lots_row[lot_qty] $bol_row[sau] </td>
</tr>";
}
}
And I'm sure you can see the problem. If there's just ONE ROW, we're okay! We finish up the row and go home. If there is more than one, we have a problem- It outputs every row.
So, basically what I need to do is say
if($num_lots>1){
for( $c=1; c < $num_lots; c==){
START FROM THE C ROW of $LOTS_RESULT!!!
}
START FROM THE SECOND RESULT
}
How can I tell $lots_result, the result of the SQL query, to start from the x row of it's retrieved results and not to spill it's guts everytime? Do I need to use a different call, like fetch_array()?
Thanks, I hope that wasn't too confusing.