我不明白为什么在这个问题上说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 ''User_notifications''
:
<?php
include 'constants.php';
$username=$_POST['username'];
$notiftable=$username.'_notifications';
$con=new mysqli('',databaseuser,databasepassword,database);
if($con)
{
$q="SHOW TABLES LIKE '$notiftable'";
答案 0 :(得分:1)
您的表名User_notifications
正在进行双重转义(即它被转义两次)。这很有可能发生,因为PHP函数已经在逃避它,而你正在第二次这样做。尽量不要自己逃避表名,即:
$q = "SHOW TABLES LIKE $notiftable";