[PHP] Post variables and mysql queries

2003-10-27 Thread Luis Lebron
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

Re: [PHP] Post variables and mysql queries

2003-10-27 Thread Chris Shiflett
--- Luis Lebron [EMAIL PROTECTED] wrote: $query=Select * from users where userid='$_POST['userid']'; Use curly braces: $query = select * from users where userid = '{$_POST['userid']}'; Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook

Re: [PHP] Post variables and mysql queries

2003-10-27 Thread John Nichel
Luis Lebron wrote: snip If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; snip Use curly braces to eval array elements inside of a string $query = SELECT * FROM users WHERE userid='{$_POST['userid']}'; -- By-Tor.com It's all