gple Posted February 21, 2008 Share Posted February 21, 2008 $query=mysql_query("select * from gaf order by '".$ordering."where test=0'"); Is this correct coding? Quote Link to comment https://forums.phpfreaks.com/topic/92342-sql-statment/ Share on other sites More sharing options...
Daniel0 Posted February 21, 2008 Share Posted February 21, 2008 No. $query=mysql_query("select * from gaf where test=0 order by ".$ordering); Quote Link to comment https://forums.phpfreaks.com/topic/92342-sql-statment/#findComment-473117 Share on other sites More sharing options...
Ken2k7 Posted February 21, 2008 Share Posted February 21, 2008 $query=mysql_query("select * from gaf order by '".$ordering."where test=0'"); Is this correct coding? Hello, Not quite. Try this: $query=mysql_query("select * from gaf where test=0 order by ".$ordering." ASC/DESC"); Where I put ASC/DESC, you should specify if you want it sorted going up or down. Ken Quote Link to comment https://forums.phpfreaks.com/topic/92342-sql-statment/#findComment-473118 Share on other sites More sharing options...
gple Posted February 21, 2008 Author Share Posted February 21, 2008 sorry didnt realize how I wrote my original code. Quote Link to comment https://forums.phpfreaks.com/topic/92342-sql-statment/#findComment-473136 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.