Post variables and mysql queries
| From: | Luis Lebron | Date: | Mon, 27 Oct 2003 16:07:27 +0000 |
| Subject: | Post variables and mysql queries | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167740@lists.php.net to get a copy of this message | ||
This may be a dumb question but here goes. I have been trying to use $_POST
globals in sql queries.
If I use the following query string it does not work
$query="Select * from users where userid='$_POST['userid']'";
However, this works
$userid=$_POST["userid"]
$query="Select * from users where userid='$userid'";
Is there a mistake in my syntax?
thanks,
Luis R. Lebron
Sigmatech, Inc