PHP variable question
- by Kyle Parisi
This works:
$customerBox = mysql_query("MY SQL STATEMENT HERE");
$boxRow = mysql_fetch_array($customerBox);
$customerBox = mysql_query("MY SQL STATEMENT AGAIN");
while($item = mysql_fetch_assoc($customerBox)) {
foreach ($item as $columnName = $value) {
if (empty($value)) {
print $columnName;
}
}
}
This does not:
$customerBox = mysql_query("MY SQL STATEMENT HERE");
$boxRow = mysql_fetch_array($customerBox);
while($item = mysql_fetch_assoc($customerBox)) {
foreach ($item as $columnName = $value) {
if (empty($value)) {
print $columnName;
}
}
}
Why? I guess I don't understand how variables work yet.