SAE mySql retrieval results, help Ah! Big God, come on in and see!

Source: Internet
Author: User
I created a table on the SAE platform MyTable, and now I want to get the data from it, but I can't get it, num output is 0, run SQL statements on the platform can be retrieved, do not know where I write the PHP statement is wrong, or what else to do?
God help me see it! What should I write? Do a half-day or not, I want to faint ah!
$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 ();
}


Reply to discussion (solution)

Please go to the special edition of PHP to ask.

Please go to the special edition of PHP to ask.


Oh, all right! I think it's related to the database, and I put it here first.

Friends, help me see it! Big God, come on!

The MySQL class that inherits the SAE can use those defined constants

1. Confirm that the MySQL service is activated
2, since the use of Saemysql class, it is time to abandon the MySQL function family

$sql = "SELECT * from ' myTable '";

Remove single quotes from ' MyTable '

The MySQL class that inherits the SAE can use those defined constants


You're right, two can't mix, now the problem has been solved, thank you!

1. Confirm that the MySQL service is activated
2, since the use of Saemysql class, it is time to abandon the MySQL function family



1. Confirm that the MySQL service is activated
2, since the use of Saemysql class, it is time to abandon the MySQL function family



Thanks for helping, now the problem has been solved, the quotation marks have not been noticed before. I am a novice, but also ask you to take more care!
  • Related Article

    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.