Here is my DB:
CREATE TABLE `tablenames` (
`tablename_id` int(5) unsigned NOT NULL auto_increment,
`tablename` varchar(25) NOT NULL default '',
PRIMARY KEY (`tablename_id`)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
When I get the DB filled, it should print like this:
A101, A102, A103
With the comma's added but none on the end.
but what I get is
1, A1012, A100
What am I doing wrong?
<php>
$sql = mysql_query("SELECT * FROM tablenames") or die (mysql_error());
$count = mysql_num_rows($sql);
for($i=0;$i<$count;$i++)
{
$row = mysql_fetch_row($sql);
$array = ($row);
$row = implode(", ", $array);
print $row;
}
</php>
CREATE TABLE `tablenames` (
`tablename_id` int(5) unsigned NOT NULL auto_increment,
`tablename` varchar(25) NOT NULL default '',
PRIMARY KEY (`tablename_id`)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
When I get the DB filled, it should print like this:
A101, A102, A103
With the comma's added but none on the end.
but what I get is
1, A1012, A100
What am I doing wrong?
<php>
$sql = mysql_query("SELECT * FROM tablenames") or die (mysql_error());
$count = mysql_num_rows($sql);
for($i=0;$i<$count;$i++)
{
$row = mysql_fetch_row($sql);
$array = ($row);
$row = implode(", ", $array);
print $row;
}
</php>