Recently I had to work with MySQL. I wrote this line on php:

$query = "SELECT 'catalog' FROM $moduls WHERE posit = 'head'"; 

After the request gives:

You have an error in your SQL syntax; check the syntax for the right syntax

I feel that the problem with quotes, tell me exactly how to?



    2 answers 2

    the name of the table in MySQL (not sure about otsalny databases) is taken not into single quotes, but into the apostraph which is in Russian And in quotes it is a string

     $query = "SELECT `catalog` FROM ".$moduls." WHERE posit = 'head'"; 
       $query = "SELECT catalog FROM ".$moduls." WHERE posit = 'head'";