Returned error warning when querying data in SAE-php Tutorial

Source: Internet
Author: User
An error is returned when data is queried in SAE. an error is returned. The SAE platform is enabled. The table has been created. to implement this function, query the record where field A contains content a and return the field B value of the record:

The code is as follows:

$ Mysql = new SaeMysql ();
Echo "Connect success
\ N ";

$ SQL = mysql_query ("SELECT * FROM 'Nature 'WHERE 'name' LIKE \ 'Wolf \' LIMIT 0, 30 ");
$ Data = $ mysql-> getData ($ SQL );
Echo $ data ['class'];

?>


The running result is:


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 cocould not be established in index. php on line 5

Warning: mysqli_query () [function. mysqli-query]: Empty query in saemysql. class. php on line 191


Where is the error?


Reply to discussion (solution)

$ SQL = mysql_query ("SELECT * FROM 'Nature 'WHERE 'name' LIKE 'wollong' LIMIT 0, 30 ");

$ SQL = mysql_query ("SELECT * FROM 'Nature 'WHERE 'name' LIKE' % Wolf % 'LIMIT 0, 30 ");

The moderator tried the two codes that you provided, and both of them gave the same warning...
Isn't saesql defining the mysql_query function?
I don't understand why...

Eye-catching
If you use the SaeMysql class, how can you use mysql functions?

$ Mysql-> getData ($ SQL)
$ SQL is an SQL command string

$ SQL = "SELECT * FROM 'Nature 'Where 'name' LIKE '% Wolf % 'limit 0, 30 ";

Thank you very much for the moderator. under your guidance, you have implemented the functions I want!

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.