maliary Posted July 9, 2007 Share Posted July 9, 2007 Is it possible to use SELECT,ORDER BY AND WHEREcommands in mysql and get results? I've tried it in the query below but it's fruitless. Where am I going wrong? $sql = "SELECT * FROM $dbtable WHERE branch = $brn ORDER BY group_id ASC , name ASC LIMIT 40,43 "; Quote Link to comment https://forums.phpfreaks.com/topic/59109-solved-using-selectorder-by-and-where/ Share on other sites More sharing options...
AndyB Posted July 9, 2007 Share Posted July 9, 2007 Change $brn to '$brn'. Other than odd choices for the start and number applied to the LIMIT, there's no other reason why that line of code - out of the context of the rest of your code - wouldn't work. Care to define "fruitless"? Quote Link to comment https://forums.phpfreaks.com/topic/59109-solved-using-selectorder-by-and-where/#findComment-293508 Share on other sites More sharing options...
maliary Posted July 13, 2007 Author Share Posted July 13, 2007 Fruitless - no action, nothing happening. Thanks, It works. Quote Link to comment https://forums.phpfreaks.com/topic/59109-solved-using-selectorder-by-and-where/#findComment-297215 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.