View Single Post
Old 04-23-2004, 08:58 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
hi michael .. we're neighbors =)

from what i'm understanding, i think you should build a new array from the records that meet the 'if' requirments.

for example:
PHP Code:
<?
$rs 
mysql_query($query,$conn);
while(
$row=mysql_fetch_array($rs)){
  if (
$row[time_start]==$round_time){
    
$new_array[] = $row[time_start];
  }
}
?>
if you are retrieving more than 1 field of each record, then i highly suggest you create a counter just so your rows stay even.

when you use $new_array[] = ... then it is just adding the value to the right o the array. it will be more precise if you use a counter to create the new array. example:
PHP Code:
<?
$counter 
0;

$rs mysql_query($query,$conn);

while(
$row=mysql_fetch_array($rs)){
  if (
$row[time_start]==$round_time){
    
$new_array[$counter]['time_start'] = $row[time_start];
    
$new_array[$counter]['other_field'] = $row[other_field];
    
$counter++;
  }
}
?>
hope that helps
__________________
Mike
sde is offline   Reply With Quote