I have been writing some code which pulls entries from a MySQL database. These are numbers 1 to 38
However, it only returns every second number i.e. 2,4,6,8 instead of 1,2,3,4.
$result = mysql_query("select (caseID) FROM `case` order by caseID")
or die(mysql_error());
while(mysql_fetch_array( $result ))
{
$row = mysql_fetch_assoc($result);
$countName= $row['caseID'];
Print $countName;
}
I've tried various changes and reducing the code to the bare minimum. But nothing seems to work.
mysql_family of functions. Now would be a great time to switch to PDO or mysqli.