Re: Repeats of values
| From: | Thomas Seifert | Date: | Tue, 31 Dec 2002 16:50:47 +0000 |
| Subject: | Re: Repeats of values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129783@lists.php.net to get a copy of this message | ||
On Tue, 31 Dec 2002 10:47:57 -0600 tony@gonefishingguideservice.com (Anthony Ritter) wrote:
> while($line = mysql_fetch_array($result)){
> print "\t<tr><td bgcolor=\"#CCCCFF\"><Font
> Face=\"arial\" size =2>\n";
> while(list (,$value) = each ($line)) {
Thats just wrong, mysql_fetch_array returns an array with all the fields accessible per
field-id and field-name so you have each field twice.
You can try this
print_r($line);
to see that.
either access the rows by using mysql_fetch_row (only an enumerated array is returned so each value
only once)
or better access the values in the array directly:
while($line = mysql_fetch_array($result)){
print "\t<tr><td bgcolor=\"#CCCCFF\"><Font Face=\"arial\"
size =2>\n";
print "<td bgcolor=\"CCCCFF\"><Font Face =\"arial\"
size=2>".$line['level']."</td>\n";
print "<td bgcolor=\"CCCCFF\"><Font Face =\"arial\"
size=2>".$line['pm']."</td>\n";
print "<td bgcolor=\"CCCCFF\"><Font Face =\"arial\"
size=2>".$line['date']."</td>\n";
print "\t</tr>\n";
}
Regards,
Thomas