Piranha/Leatherback
The subquery seems very simple but it is not working. Obviously I must be doing something wrong. This is what I have:
mysql_connect($hostname,$username,$password) or die(mysql_error());
mysql_select_db("$dbname") or die(mysql_error());
$data = mysql_query("SELECT FROM(SELECT FROM $usertable ORDER BY DATE DESC LIMIT 20)ORDER BY RAND() LIMIT 3")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
echo $info['title'];
}
I tried all combinations of quotes (single and double) in the SELECT but it didn't work either
It is giving 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 "SELECT * FROM $usertable ORDER BY DATE DESC LIMIT 20)ORDER
Thanks