1

this is the error i get... ou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 1' at line 1

my code looks like this:

$sql = "SELECT * FROM posts WHERE id=$pid LIMIT 1";

I mean where can i find the manual? and what do i wrong?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • 2
    _where can I find the manual_ => Google `mariaDB user manual` – RiggsFolly Mar 26 '20 at 17:17
  • 3
    I'm guessing `$pid` is empty, which will screw up your query. Drop the `LIMIT 1`, and see if the query works at all. You can also `echo $sql;` to see exactly what the query contains. – aynber Mar 26 '20 at 17:19
  • 1
    Does this answer your question? [SQL syntax error MariaDB server version for the right syntax to use near 'WHERE ID = 4' at line 1](https://stackoverflow.com/questions/27302605/sql-syntax-error-mariadb-server-version-for-the-right-syntax-to-use-near-where) – pringi Mar 26 '20 at 18:32

0 Answers0