Re: Use the User Input Critia as part of Query! (Mysql)
| From: | Mike Barber | Date: | Mon, 03 Sep 2001 16:33:46 +0000 |
| Subject: | Re: Use the User Input Critia as part of Query! (Mysql) | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9179@lists.php.net to get a copy of this message | ||
$query="select name,department,Leave_From,Leave_To,Leave_Total,Reason from
leaverequest where Staff_Number='$StaffNum'"
will work just fine.
(Enclose vars with single quotes)
----- Original Message -----
From: "Jack" <jack@nedcor.com>
To: <php-db@lists.php.net>; <php-windows@lists.php.net>
Sent: Monday, September 03, 2001 10:35 AM
Subject: [PHP-WIN] Use the User Input Critia as part of Query! (Mysql)
> Dear all
> I had a form which ask user to input the Staff Number to be as part of the
> query, but when i execute it, it seems not working at all
>
> here is what i wrote in php
> The user input box is : $StaffNum
>
> $query="select name,department,Leave_From,Leave_To,Leave_Total,Reason from
> leaverequest where Staff_Number="<?print("$StaffNum");?>" and
> authorized
is
> null";
>
> But said there is error on this line, which is what i expected!!
>
> So could anyone pls tell me how i can get the varaible into part of the
> Query of Mysql?
>
> Thx
> jack
> jack@nedcor.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>