Hi all,
I guess I don't understand either the implode() function or the mysql_fetch_array() function properly... because the code below returns the query results ok, just with each column duplicated.
-eg. for a table:
col1 col2
addam 10 smith st
john 20 simpson lane
it returns
addam addam 10 smith st 10 smith st
john john 20 simpson lane 20 simpson lane
how can i remove the duplicate columns?
<CODE>
$connection = mysql_connect($server, $user, $pass);
$result=mysql_db_query($db, $query, $connection);
echo ("<TABLE>");
while($row=mysql_fetch_array($result))
{
$x='<TD>' . implode("</TD>\n<TD>", $row);
echo "<TR>" . $x . "</TR>\n";
}
echo ("</TABLE>\n");
}
</CODE>