RE: [PHP-DB] $var inside a mysql query?
| From: | Wesley Choate | Date: | Mon, 24 Jul 2000 19:04:49 +0000 |
| Subject: | RE: [PHP-DB] $var inside a mysql query? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1440@lists.php.net to get a copy of this message | ||
Yes, but if ApplicationAcronym is nut numeric you will need single quotes
around your variable..like this
$description=mysql_query("select GeneralDescription from Application
where ApplicationAcronym='$choix'", $db);
Wesley Choate
> -----Original Message-----
> From: ROUSSY, ISABELLE [SMTP:isabelle.roussy@bell.ca]
> Sent: Monday, July 24, 2000 1:59 PM
> To: php
> Subject: [PHP-DB] $var inside a mysql query?
>
> Hello,
>
> Can we perform a sql query using a variable inside the php code? This is
> what I'm tryig to do
> $description=mysql_query("select GeneralDescription from Application
> where ApplicationAcronym=$choix", $db);
>
> --
> Isabelle Roussy
> Bell Canada
> IS/IT - Billing Requirements
> 700 de La Gauchetiere W B8W2 Montreal Qc H3B 4L1
> Mailto:isabelle.roussy@bell.ca
> Office (514) 391-7939 Fax (514) 393-8162
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>