RE: [PHP] Simple PHP 4 and MySQL question about query - Problem solved!
| From: | SED | Date: | Tue, 20 Mar 2001 03:53:35 +0000 |
| Subject: | RE: [PHP] Simple PHP 4 and MySQL question about query - Problem solved! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44680@lists.php.net to get a copy of this message | ||
Thank you all for your replies.
The following solved my problem (from David Robley):
--------------
Also you shouldn't need single quotes around islname - so
your query might look more like:
$result = mysql_query("SELECT islname FROM $table WHERE id=$id");
--------------
Then I was able to use: mysql_result($result, 0); to get the result.
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: sed@sed.is
Homepage: www.sed.is <- New Homepage!
------------------------------------------
-----Original Message-----
From: SED [mailto:sed@sed.is]
Sent: Tuesday, March 20, 2001 1:15 PM
To: php-general@lists.php.net
Subject: [PHP] Simple PHP 4 and MySQL question about query
Hi,
I'm trying to get a result from the following query:
$result = mysql_query("SELECT 'islname' FROM $table WHERE id='$id'");
Because "id" is a unique key in my table, I know it has only one value. What
mysql_funtion should I use to echo the result and with what parameters?
(I have tried many most of the functions but I don't get the correct result,
and the manual is not helping me :)
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: sed@sed.is
Homepage: www.sed.is <- New Homepage!
------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net