[Wolves] PHP Sql select losing a row
Wayne Morris
waynelists at machx.co.uk
Tue Jul 9 10:46:46 UTC 2013
Hi,
I have the following select which loses one row from the database - ie
it produces 4 rows instead of the correct 5.
And ideas what I am doing wrong?
$queryz = "SELECT *
FROM property
WHERE postcode like '%$postcodevoid%' and let = '1'
";
$resultz = mysql_query($queryz);
$num_rows = mysql_num_rows($resultz);
$rowz = mysql_fetch_array($resultz);
for($i=1; $i <= $num_rows; $i++)
while($rowz = mysql_fetch_array($resultz)) {
print("<TABLE border=\"1\" cellspacing\"0\" cellpadding=\"0\" width=100%
style=\"font-size: 10pt\">\n");
print("<TD width=10% wrap style=\"wrap: 1 solid
#800000\">".$rowz["address1"]." </td> ". " ");
print("<TD width=5% wrap style=\"wrap: 1 solid
#800000\">".$rowz["address2"]." </td>");
print("<TD width=5% wrap style=\"wrap: 1 solid
#800000\">".$rowz["postcode"]." </td>");
}
cheers
More information about the Wolves
mailing list