For anyone still using the old "mysql_fetch_assoc" here is something I've just discovered today after about 9 years of PHP'ing and thought I should sahre because I've not seen many open source projects use it (maybe for another reason I'm not yet aware of)...
(note: both provide the exact same output)
if ($no_of_records > 0) {
$overhead_info = mysql_fetch_assoc($sql_result);
extract($overhead_info);
}
echo "$rid, $type, $summary, $details, $cost, $purchase_date";
############ instead of ###############
if ($no_of_types > 0) {
while ($overhead_type_info = mysql_fetch_assoc($sql_result))
{
$rid = $overhead_type_info['row'];
$type = $overhead_type_info['type'];
$summary = $overhead_type_info['summary'];
$details = $overhead_type_info['details'];
$cost = $overhead_type_info['cost'];
$purchase_date = $overhead_type_info['purchase_date'];
}
echo "$rid, $type, $summary, $details, $cost, $purchase_date";
}