Home > Backend Development > PHP Tutorial > SAE中查询数据返回异常警告

SAE中查询数据返回异常警告

WBOY
Release: 2016-06-13 12:24:10
Original
1326 people have browsed it

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 ";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template