我不明白为什么它说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'";
最佳答案
您的表名User_notifications
正在被双重转义(即它被转义两次)。这种情况很可能发生,因为 PHP 函数已经对其进行了转义,而您正在第二次执行此操作。尝试不要自己转义表名称,即:
$q = "SHOW TABLES LIKE $notiftable";
关于mysql - SHOW TABLES LIKE 上的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36996108/