I'm just starting to get into this array stuff. I understand database concepts and can connect to the database, but I just can't seem to fetch an array properly. Maybe I'm missing something. I can execute a foreach statement, but I can't seem to extract rows where I could attach an <a href> Can anybody figure out what I'm doing wrong?
$query = "SELECT mtg_type, mtg_address, mtg_city, mtg_pin, mtg_principal_bal, mtg_year,
mtg_sale_date
FROM mtg_foreclosure
$search ";
$result = mysql_query($query)
or die(mysql_error());
function get_alt_row_color($i,$light_color="#ffffff",$dark_color="#E6EFFD") {
if ($i % 2 == 0) {
return $light_color;
} else {
return $dark_color;
}
}
while($row = mysql_fetch_array($result) {
$content = $row['mtg_principal_bal'];
$content .= $row['mtg_city'];
$content .= $row['mtg_year'];
$line_count++;
}
echo "$content";
mysql_free_result($result);
mysql_close($connect);
?>