So I am trying to select rows from a table called articles based on the ID. For some reason, I am having a problem with this and I am not sure why. The exact problem is that the script echoes a FATAL ERROR
which means that my query is not working.
I updated the script to echo the error and here it is:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''Articles' WHERE 1' at line 1
Here is the code:
$id = 1;
$query = mysql_query("SELECT * FROM 'Articles' WHERE ID = '$id'") or die("FATAL ERROR");
I tried just a simple select statement and that didn't work either:
$query = mysql_query("SELECT * FROM 'Articles' WHERE 1") or die("FATAL ERROR");
Help is much appreciated, thanks!