note 75012 deleted from function.mysqli-fetch-assoc by tularis
| From: | tularis@php.net | Date: | Tue, 08 May 2007 17:10:30 +0000 |
| Subject: | note 75012 deleted from function.mysqli-fetch-assoc by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126333@lists.php.net to get a copy of this message | ||
Note Submitter: jcwebb at dicoe dot com
Reason: bad code
----
Need to turn 1 row into a string ?
<?php
$q="SELECT * FROM SomeTable WHERE id=23";
$r=mysqli_query($DBlink,$q) or die(mysqli_error($DBlink)." Q=".$q);
$n=mysqli_num_rows($r); if ($n==1): $w=mysqli_fetch_assoc($r); endif;
$mylist=''; foreach ($w as $v): $mylist.=$v.','; endforeach;
$mylist=substr($mylist,0,-1);
echo $mylist;
?>
Hope it helps, Jon