Jump to content

[SOLVED] First result in array being ignored


GreenSmurf

Recommended Posts

I have some code where no matter how I sort the info- the first result is ignored in the display. If anyone can see something wrong in the code let me know. Thanks.

 

$lastditch_result = mysql_query("SELECT * FROM customers ORDER BY Last,First");
$lastditch_row = 0;
if ($lastditch_row <= mysql_fetch_array($lastditch_result)) {
	beginPrettyTable("6", "$lCustomers");
	beginBorderedTable("6");
	echo ("<tr>\n");
	echo ("<td><b>$lName</b></td> <td><b>$lCompany</b></td><td><b>$lAddress</b></td> <td><b>$lEmail</b></td>\n <td><b>$lBalance</b></td> <td><b>$lActions</b></td>\n </tr>\n");
	while ($lastditch_row = mysql_fetch_array($lastditch_result)) {
		if($class == "odd") { $class = "even"; } else { $class = "odd"; }
		if($lastditch_row["Balance"] >= 0) { $bal_class = "positive"; } else { $bal_class = "negative"; }
		printf("<tr class='$class'>\n<td align='left'><a href='%s?CustomerID=%s'>%s %s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td><div class='$bal_class'>%.4f</div></td> <td align='center'><a href='%s?CustomerID=%s'><img src='images/edit.gif' width=24 height=24 border=0></a><a href='confirm.php?action=deletecustomer&CustomerID=%s'><img src='images/delete.gif' height=24 width=24 border=0 alt='$lDelete'></a></td></tr>\n", $PHP_SELF, $lastditch_row["CustomerID"], $lastditch_row["First"], $lastditch_row["Last"], $lastditch_row["Company"], $lastditch_row["Address"], $lastditch_row["Email"], $lastditch_row["Balance"], $PHP_SELF,$lastditch_row["CustomerID"],$lastditch_row["CustomerID"]);
	}
	endPrettyTable();
	endBorderedTable();
} else {
	echo ("<tr><td>$lNoProfilesFound...</td></tr>\n"); 
}

 

-GreenSmurf

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.