query string syntax problems...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stv
Forum Newbie
Posts: 6
Joined: Thu Oct 19, 2006 8:29 am

query string syntax problems...

Post by stv »

hi folks, I'm a beginner in php so please be patient. my question is why this query doesn't work?

Code: Select all

$query = "SELECT * FROM `songs` LIMIT '" . $_REQUEST['fromID'] . "','" . $_REQUEST['toID'] . "'";
thanks for help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

echo $query please.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Can I also make a small suggestion? Do not use the $_REQUEST superglobal if you know the values are coming from GET or POST. Use GET or POST. Also, don't hit the query directly with the passed information. Validate first. Just a suggestion. Post what the query is actually seeing so we can go from their.
Post Reply