mysql_fetch_array()
| From: | Libor Matyáš | Date: | Fri, 18 Aug 2000 13:27:19 +0000 |
| Subject: | mysql_fetch_array() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2158@lists.php.net to get a copy of this message | ||
Hello,
this is the code i used:
$spojeni=mysql_connect("****","***","***");
if (!spojeni) {
break;
}
mysql_select_db("***", $spojeni);
$proved=mysql_query("select * from tb_main",$spojeni);
while ($zaznam=mysql_fetch_array($proved)) {
$pocet=count($zaznam);
for($x=0; $x<$pocet; $x++) {
echo $zaznam[$x]."\n";
echo "<br>*****<br>";
}
echo $pocet;
}
the table's got 5 fields, why does $pocet=10?
it's always double the number of fields the table has.
with ..fetch_row... one gets the right number.