Re: php variables in sql statements.
| From: | Ifrim Sorin | Date: | Mon, 19 Feb 2001 16:10:55 +0000 |
| Subject: | Re: php variables in sql statements. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40584@lists.php.net to get a copy of this message | ||
It is possible, but the syntax is :
$sql = "select businessname from main where businesstype =
'consultancy' and " .$community." != '0'";
This is the case where $comunity is the name of a field.
Regards
Sorin Ifrim
----- Original Message -----
From: Matt Davis <matt@roundyourway.co.uk>
To: Php Mailing List <php-general@lists.php.net>
Sent: Monday, February 19, 2001 6:05 PM
Subject: [PHP] php variables in sql statements.
> Can someone tell me if this is possible.
>
> I have a PHP variable which i got from a html form using $HTTP_POST_VAR.
I
> collect a variable called Community. Therefore is it possible to have an
sql
> statement like this?
>
> file://create sql statement
>
> $sql = "select businessname from main where businesstype =
> 'consultancy' and $community != '0'";
>
>
> if this is not ok how else can i extract a variable from another html
page.
>
> Matt.
>
>
> --
> 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
>