Илья as Destructor
Новичок
При выполнении скрипта выводит ошибку, при этом phpMyAdmin нормально выполняет запрос. Подскажите в чем проблема.
Сообщение об ошибке:
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 '' at line 1
Код скрипта:
Спасибо.
Сообщение об ошибке:
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 '' at line 1
Код скрипта:
PHP:
$sql = "SELECT * FROM relations WHERE `primary_table` =" . $id_table;
$result = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
$relations[]=array(
"id_relation" =>$row['id_relation'],
"primary_table" =>$row['primary_table'],
"primary_field" =>$row['primary_field'],
"secondary_fields"=>$row['secondary_fields'],
"foreign_table" =>$row['foreign_table'],
"foreign_field" =>$row['foreign_field'],
"master_fields" =>$row['master_fields']
);
}