I'd like to select data from a table. One column in the table (type) can have a value of 1 to 6.
I do different things with the data depending on the value. If the value comes up as 4, I need to look at a column (group) and then as I continue through the table, I need it to miss out any fields where the value of type is 4 and the value of group has come up before.
Is there a way to do this in a loop.
Many Thanks.
I do different things with the data depending on the value. If the value comes up as 4, I need to look at a column (group) and then as I continue through the table, I need it to miss out any fields where the value of type is 4 and the value of group has come up before.
Is there a way to do this in a loop.
Code:
$sql="SELECT * FROM table WHERE id=$id_value";
$result=mysql_query($sql,$db) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$class=new class_name($db, $table, $row['id']);
[I]process data[/I]
}
Comment