• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some php/mysql help quick.

cpals

Diamond Member
Yeah, I know. Wrong forum, but I need the help right now, not next week.

I have this code:
$result = mysql_query ($query)
while ($line = mysql_fetch_array($result)) {
print "\t<tr>\n";
while(list($col_name, $col_value) = each($line)) {
print "\t\t<td>$col_value</td>\n";
}

It prints out ever column value twice. My brains fried and I can't figure it out. It's probably something stupid.
 
Why don't you just use mysql_fetch_row instead? Kinda pointless for you to use mysql_fetch_array to get an associative array and then convert it back to numerical array when mysql_fetch_row will give you what you want. That said, try this:

while ( list( $col_name, $col_value ) = mysql_fetch_row( $result ) ) {
print "\t<tr>\n";
print "\t\t<td>$col_value</td>\n";
}
 
Back
Top