I was wondering..
i wrote this piece of code...
Code: Select all
include "connect.php";
$sql="select * from users";
$result=mysql_query($sql);
$field_count = mysql_num_fields($result);
$row_count = mysql_num_rows($result);
for($i=0;$i<$field_count;$i++)
{
$field_name = mysql_field_name($result, $i);
echo $nama_field;
echo '</br>';
for($j=0;$j<$row_count;$j++)
{
$record = mysql_fetch_array($result);
echo $record[$field_name];
echo '</br>';
}
}instead it turn out to be like this :
I relly can't figured it out, honestly..what went wrongUser_ID
1
2
3
Name
I will be very greatfull if anyone can tell me where did I do wrong.
Thank