THE BORE
General => The Superdeep Borehole => Topic started by: GilloD on June 27, 2009, 08:11:35 PM
-
Okay, so I'm using mysql_fetch_array to fetch a bunch of rows from a table.
$query_lots="SELECT * FROM lots_new WHERE lot_sku_id='$curr_key'";
$lots_result=mysql_query($query_lots) or die(mysql_error());
while($lots_row=mysql_fetch_array($lots_result)){
}
How can I tell $lots_result to SKIP the first row? I want to start with the SECOND result and move to the end. I can get a count of the rows in teh $result via mysql_num_rows, but I can't tell it "JUST GIVE ME ROW 2 and ONWARDS"
-
http://www.vbforums.com/showthread.php?t=354146
-
Hmm.
Okay, let me expand my explanation a bit.
Basically, the first result row is displayed in one way.
Every row AFTER that first row is displayed differently. But I can't just use an "if num_row>1" because it'll pop out EVERY row for EVERY success. So I need to go ahead and display row one, then do a conditional which BEGINS at row 2. I sitll need row 1.
-
I could setup two querys- One limited to 1 and one going from 2 and beyind, but that seems dumb
-
$lots_result = ...
$first_row_values = mysql_fetch_array($lots_result))
while ($row = mysql_fetch_array($lots_result)) {
... 2onwards}
So it rips off the first result, I always display that one and if there are others remaining we deal with them