SAEmySql cannot retrieve the results. please come and have a look.

Source: Internet
Author: User
SAEmySql cannot retrieve results. ask for help! Let's take a look! I have created a table myTable on the SAE platform, & nbsp; now I want to get data from it, but I cannot get it at all. & nbsp; num outputs 0, running SQL statements on the platform can be retrieved. I don't know where my PHP statements are wrong or what operations do I need? Let me have a look! What should I do? I still can't do it for a long time. I'm dizzy! $ Link & nbsp SAE mySql cannot find the result. ask for help! Let's take a look!
I have created a table myTable on the SAE platform. now I want to obtain data from it, but I cannot get it at all. num outputs 0, running SQL statements on the platform can be retrieved. I don't know where my PHP statements are wrong or what operations do I need?
Let me have a look! What should I do? I still can't do it for a long time. I'm dizzy!
$ 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 ();
}
------ Solution --------------------
For PHP, go to a special version.
------ Solution --------------------
Only mysql classes that inherit sae can use the defined constants
------ Solution --------------------
1. confirm that the mysql service is activated.
2. since the SaeMysql class is used, you should discard the mysql function family.
------ Solution --------------------
$sql = "SELECT * FROM 'myTable'";

Remove single quotes in 'mytable'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.