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? 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); 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 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. Link to comment https://forums.phpfreaks.com/topic/92342-sql-statment/#findComment-473136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.