RE: [PHP] Fields printing twice
| From: | Fatih Üstündağ | Date: | Mon, 12 May 2003 14:36:08 +0000 |
| Subject: | RE: [PHP] Fields printing twice | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147305@lists.php.net to get a copy of this message | ||
Since mysql_fetch_array returns array with associative indices and numeric
indices,
you will get each field twice by using implode.
you can use :
$row = mysql_fetch_array($result,MYSQL_NUM) ( or MYSQL_ASSOC )
-----Original Message-----
From: Brian V Bonini [mailto:b-bonini@cox.net]
Sent: Monday, May 12, 2003 5:26 PM
To: PHP Lists
Subject: [PHP] Fields printing twice
Why does this print each DB field twice?
$line_break = "\r\n";
while ($row = mysql_fetch_array($result)) {
if ($csv) {
$semi_separated = implode(";", $row);
print $semi_separated . $line_break . "<br>";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php