Forum Moderators: coopster
This is what I need.
I have many attributes for each item
AC
AR
PR
FR
Hp
Pow
etc
etc
I am wanting to display only the attributes which have values and I beleive an array would be the easiest way to do this.
So my first question.
Can I put mysql database values into an array?
I tried and it did not work. I used this as my value
$row["AC"];
If someone could correctly insert this into an array and show me I would be very thankful.
Second is how would I go about only showing the attribute name if there is a value in it?
while ($row = mysql_fetch_array($result)) {
print '<tr>';
print '<td>';
foreach ( $row as $key => $val ) {
if (!empty($val) && $key!= "Item_Name" ) {
print $key . " : " . $val . ' ';
}
}
print '</td>';
print '</tr>';
} [edited by: coopster at 6:20 pm (utc) on June 23, 2004]
[dev.mysql.com...]