note 23020 deleted from ref.mysql by philip
| From: | philip@php.net | Date: | Tue, 16 Jul 2002 15:52:31 +0000 |
| Subject: | note 23020 deleted from ref.mysql by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33134@lists.php.net to get a copy of this message | ||
i noticed this by mistake... [i've only been doing php for a while so bare that in my mind] you
can just do something like
$result = mysql_fetch_assoc("SELECT * FROM myTbl WHERE userId = $id");
<?=$result["userName"]?>;
previously i'd been doing this in two steps:
$query = mysql_query("SELECT * FROM myTbl WHERE userId = $id");
$result = mysql_fetch_assoc($query);
<?=$result["userName"]?>;
because i thought that was how it had to be done... weird. any thoughts? eg. speed differences
between the two?
thanks, Neill