Home > Backend Development > PHP Tutorial > SAE mySql 检索不出结果,大神快进来看看

SAE mySql 检索不出结果,大神快进来看看

WBOY
Release: 2016-06-13 11:56:27
Original
867 people have browsed it

SAE mySql 检索不出结果,求助啊!大神快进来看看!
我在SAE平台上创建了个表myTable, 现在我想从中获取数据,但根本获取不到, num输出的是0,在平台上运行SQL语句是可以检索出来的,不知道我PHP语句哪里写错了,还是需要别的什么操作呢?
大神们帮我看看吧!应该怎么写啊?搞了半天还是不行,我要晕了啊!
$link = mysql_connect (SAE_MYSQL_HOST_M . ':' . SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS);
mysql_select_db (SAE_MYSQL_DB, $link);
if($link)
{
$mysql = new SaeMysql();
$sql = "SELECT * FROM 'myTable'";

$num = 0;
while($data = $mysql->getData($sql))
{
++$num;
}

$numLine = count($data);
$mysql->closeDb();
}
------解决方案--------------------
PHP的请去专门的版问问。
------解决方案--------------------
继承sae的mysql类才可以用那些定义的常量
------解决方案--------------------
1、确认 mysql 服务已经激活
2、既然使用 SaeMysql 类,就该放弃 mysql 函数族
------解决方案--------------------

$sql = "SELECT * FROM 'myTable'";
Copy after login
  
去掉'myTable'中的单引号

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