Jump to content

My query is resulting in error....why ?


jd2007

Recommended Posts

select $this->id, $this->title, $this->thumbnail from $this->table order by 'select $this->past from $this->table2'

 

the above is my query....what's wrong ? this is the error:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from flash order by 'select past from awards'' at line 1

Link to comment
https://forums.phpfreaks.com/topic/65961-my-query-is-resulting-in-errorwhy/
Share on other sites

its valid

 

 

function latestSubmissionAwards($ext="")
{
	if ($ext=="")
	{
     $this->que="select $this->id, $this->title, $this->thumb from $this->table order by $this->past desc limit 5";
	 $this->res=mysql_query($this->que);
     $this->showSubm(); 
    }
    else
    {
      $this->table2=$ext;
	  $this->que="select $this->id, $this->title, $this->thumbnail from $this->table order by 'select $this->past from $this->table2";
	  $this->res=mysql_query($this->que);
     $this->showSubm(); 	
	}
}

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.