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 <[EMAIL PROTECTED]>
To: Php Mailing List <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]