SAE中查询数据返回异常警告
程序员文章站
2022-04-23 12:13:27
...
SAE中查询数据返回错误警告
SAE平台,数据库已开启,表格已经建好,希望实现功能:查询字段A包含内容a的记录,返回该记录的字段B值:
代码如下:
$mysql = new SaeMysql();
echo "Connect success
\n";
$sql = mysql_query("SELECT * FROM `nature` WHERE `name` LIKE \'狼\' LIMIT 0, 30 ");
$data = $mysql->getData($sql);
echo $data['class'];
?>
运行结果为:
Connect success
Warning: mysql_query() [function.mysql-query]: this app is not authorised in index.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in index.php on line 5
Warning: mysqli_query() [function.mysqli-query]: Empty query in saemysql.class.php on line 191
请问下各位大大,是错在哪呢?
------解决思路----------------------
$sql = "SELECT * FROM `nature` WHERE `name` LIKE '%狼%' LIMIT 0, 30 ";
SAE平台,数据库已开启,表格已经建好,希望实现功能:查询字段A包含内容a的记录,返回该记录的字段B值:
代码如下:
$mysql = new SaeMysql();
echo "Connect success
\n";
$sql = mysql_query("SELECT * FROM `nature` WHERE `name` LIKE \'狼\' LIMIT 0, 30 ");
$data = $mysql->getData($sql);
echo $data['class'];
?>
运行结果为:
Connect success
Warning: mysql_query() [function.mysql-query]: this app is not authorised in index.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in index.php on line 5
Warning: mysqli_query() [function.mysqli-query]: Empty query in saemysql.class.php on line 191
请问下各位大大,是错在哪呢?
------解决思路----------------------
$sql = "SELECT * FROM `nature` WHERE `name` LIKE '%狼%' LIMIT 0, 30 ";
相关文章
相关视频
上一篇: PHP中用hash实现的数组_PHP教程
下一篇: 在上海的PHP学习之旅