note 23020 added to ref.mysql
| From: | suchaprettyhouse at hotmail dot com | Date: | Sun, 07 Jul 2002 03:05:12 +0000 |
| Subject: | note 23020 added to ref.mysql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32694@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
--
http://www.php.net/manual/en/ref.mysql.php
http://master.php.net/manage/user-notes.php?action=edit+23020
http://master.php.net/manage/user-notes.php?action=delete+23020
http://master.php.net/manage/user-notes.php?action=reject+23020