I have a product database, primary key $code. When I extract records using:
$query = "SELECT * FROM products ORDER BY code,name";
$result = mysql_query($query) or die ("Could not find information");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
while ($row = mysql_fetch_array($result)) {
extract($row);
//display records }
every record is retrieved okay.
However, when I try to extract only those records in a particular catagory by adding a WHERE list='$list' expression to the query I get all the appropriate records returned except the first record.
If I add a null record to the database under the catagory it gets lost but all the real data is retrieved.
I am not indexing any fields apart from the primary key.