Jump to content

SQL statment


gple

Recommended Posts

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.