MySQL order by error in PHP
- by theflyinghaiwian
Hi, I'm making a simple cms system for a site I'm making for non-tech users to edit... So far so good but when I try and run this code I keep getting: 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 ''pages' ORDER BY 'pages'.'pageOrder' ASC LIMIT 0 , 30' at line 1
By the error it looks like a problem with the order by section and indeed it works without it...
$sql = "SELECT * FROM 'pages' ORDER BY 'pages'.'pageOrder' ASC LIMIT 0 , 30";
$result = mysql_query($sql) or die(mysql_error());
Now I know there is nothing wrong with the code because originally I wrote my own SQL but then after it failed I robbed some from phpmyadmin and it still gives the error but it works in phpmyadmin... I'm really at my wits end with this, help is very much appreciated thank you...