Greetings!

I am using PHP and MySQL in RedHat 6.0.
I have used mysql_fetch_array() to display the datas in web page but all the
columns are printed twice. What can be the wrong with my code:
<?php
$connection=mysql_connection(...............);
$db=mysql_select_db(.....................);
$sql="select * from my db";
$sql_result=$mysql_query($sql,$connection);
print "<table>";
while ($row=mysql_fetch_array($sql_result))
    {
    print "<tr>";
    foreach ($row as $field)
        print "<td>$field</td>";
    print "<td><a href=\"search.php?ID=$row[ID]\">";
    print "Get it";
    print "</a></td>";
    print "</tr>";
    }
print "</table>";
?>

But it works fine with mysql_fetch_row() however it does not pass the pass
the variable ID.

Looking forward to hearing from you.

Warm regards,
DT






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to