Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial SAE mySql 检索不出结果,求助啊!大神快进来看看!

SAE mySql 检索不出结果,求助啊!大神快进来看看!

Jun 23, 2016 pm 01:57 PM
Great God Search

我在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的请去专门的版问问。

PHP的请去专门的版问问。


哦,好吧!我看是和数据库相关的就先放到这里了

朋友们,帮我看看吧!大神快来!

继承sae的mysql类才可以用那些定义的常量

1、确认 mysql 服务已经激活
2、既然使用 SaeMysql 类,就该放弃 mysql 函数族

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

继承sae的mysql类才可以用那些定义的常量


你说的对,两个不能混着用,现在问题已经解决了,多谢!

1、确认 mysql 服务已经激活
2、既然使用 SaeMysql 类,就该放弃 mysql 函数族



1、确认 mysql 服务已经激活
2、既然使用 SaeMysql 类,就该放弃 mysql 函数族



多谢帮忙,现在问题已经解决了,引号问题之前也没注意。我是新手,还请大家多关照!
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Interaction between Redis and Golang: How to achieve fast data storage and retrieval Interaction between Redis and Golang: How to achieve fast data storage and retrieval Jul 30, 2023 pm 05:18 PM

Interaction between Redis and Golang: How to achieve fast data storage and retrieval Introduction: With the rapid development of the Internet, data storage and retrieval have become important needs in various application fields. In this context, Redis has become an important data storage middleware, and Golang has become the choice of more and more developers because of its efficient performance and simplicity of use. This article will introduce readers to how to interact with Golang through Redis to achieve fast data storage and retrieval. 1.Re

Which one is better, win7 or 8.1? The master will tell you Which one is better, win7 or 8.1? The master will tell you Jul 19, 2023 pm 12:21 PM

Speaking of windows system, I believe many people are familiar with it. Many of us are now using windows system, and windows contains multiple system versions, including win7 and win8.1. Some netizens don’t know whether to choose win7 or 8.1 system. Which one is better, win7 or 8.1? The master will tell you the differences and choices between win7 and win8.1. Windows8.1 has a gorgeous interface. But the improvements are greater, and the shortcomings are also greater. The more obvious ones include blurred game fonts and insufficient memory bugs. No matter how large the memory is, when running some games, it will prompt that the memory is insufficient and needs to be closed. In fact, during the inspection, the memory was normal. One is that there is a problem with the memory management mechanism, and the other is that

From novice to master: Sharing experience in Go language project development From novice to master: Sharing experience in Go language project development Nov 02, 2023 pm 03:15 PM

From Novice to Master: Sharing Experience in Go Language Project Development In recent years, Go language has become more and more popular among developers because of its simplicity and efficiency. As an open source programming language, Go has the advantages of strong concurrency, static type checking, and automated memory management, and has been favored by many large Internet companies. As a novice developer who started learning Go from scratch, I continued to explore and learn during the project development process, and gradually grew into a master who can independently develop Go projects. I have accumulated some experience and insights. Today I will discuss with you big

How to leverage Elasticsearch and PHP for document management and retrieval How to leverage Elasticsearch and PHP for document management and retrieval Jul 08, 2023 pm 01:18 PM

Overview of how to use Elasticsearch and PHP for document management and retrieval Elasticsearch is an open source distributed search engine with powerful text search and analysis capabilities. PHP is a popular server-side programming language widely used for web development. This article will introduce how to use Elasticsearch and PHP for document management and retrieval, and provide code examples to help readers understand and practice. Install and configure Elasticsearch First, we need

How to achieve efficient data storage and retrieval in go language How to achieve efficient data storage and retrieval in go language Aug 06, 2023 am 10:06 AM

How to implement efficient data storage and retrieval in Go language Introduction: In the process of developing applications, data storage and retrieval are a very important part. An efficient data storage system can provide fast and reliable data storage and retrieval capabilities. As a high-performance, efficient and easy-to-use programming language, Go language provides various libraries and tools to help developers achieve efficient data storage and retrieval. This article will introduce how to implement efficient data storage and retrieval in Go language. First, we will introduce common data storage methods,

Open-world understanding of 3D point clouds, classification, retrieval, subtitles and image generation Open-world understanding of 3D point clouds, classification, retrieval, subtitles and image generation Jun 04, 2023 pm 03:04 PM

What do you get when you input the three-dimensional shapes of a rocking chair and a horse? Wooden cart and horse? Get a carriage and an electric horse; a banana and a sailboat? Get a banana sailboat; eggs plus deck chairs? Get the egg chair. Researchers from UCSD, Shanghai Jiao Tong University, and Qualcomm teams proposed the latest three-dimensional representation model OpenShape, making it possible to understand the open world of three-dimensional shapes. Paper address: https://arxiv.org/pdf/2305.10764.pdf Project homepage: https://colin97.github.io/OpenShape/Interactive demo: https://huggingface.co/spaces/OpenShape/op

How to achieve fast data storage and retrieval functions through Redis How to achieve fast data storage and retrieval functions through Redis Jul 30, 2023 pm 03:01 PM

How to achieve fast data storage and retrieval functions through Redis Redis is a fast, reliable and open source in-memory data storage system. It supports a variety of data structures and provides efficient data storage and retrieval functions. This article will introduce how to use Redis to achieve fast data storage and retrieval, and give relevant code examples. 1. Install and configure Redis. First, you need to install Redis and configure it accordingly. You can download the latest version of Redis from the official website of Redis and follow the official

How to use PHP to retrieve Base64 format images in Qiniu Cloud Storage? How to use PHP to retrieve Base64 format images in Qiniu Cloud Storage? Sep 05, 2023 pm 03:46 PM

How to use PHP to retrieve Base64 format images in Qiniu Cloud Storage? With the rapid development of the Internet, the use of images is becoming more and more widespread, so how to obtain and display images quickly and efficiently has become particularly important. Qiniu Cloud Storage is a company that provides professional cloud storage services. It provides developers with rich APIs to operate pictures stored on Qiniu Cloud. This article will introduce how to use PHP to retrieve Base64 format images in Qiniu Cloud Storage. First, we need to register a

See all articles