This is my code
// basic inbox
if ($f == 0 || empty($f)) $OWLS = mysql_query("SELECT * FROM owlpost WHERE receiver = '$userID', removed = '0', folder = '0' ORDER BY dateline DESC") or die(mysql_error());
else $OWLS = mysql_query("SELECT * FROM owlpost WHERE receiver = '$userID', removed = '0', folder = '0' ORDER BY dateline DESC") or die(mysql_error());
// loop
while ($OWL = mysql_fetch_object($OWLS)) {
echo "
<tr bgcolor=\"#000000\">
<td width=\"22%\">" . date("d M, Y - H:i" , $OWL->dateline) . "</td>
<td width=\"75%\"><a href=\"$PHP_SELF?id=" . $OWL->id . "\">" . $OWL->title . "</a> from <a href=\"profile.php?id=" . $OWL->from . "\">" . getName($OWL->from) . "</a></td>
<td width=\"3%\"><input type=\"checkbox\" name=\"delete[" . $OWL->id . "]\"></td>
</tr>
";
}
Now when I execute this code I get the following 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 ' removed = '0', folder = '0' ORDER BY dateline DESC' at line 1
At first I thought that I couldnt use the name 'removed' for a row but I changed it and it still did not work. I have renamed a few rows a few time and I still get the same error. I have no idea why I am getting this error.