Novices don't know much about jquery, please do me a favor.

Source: Internet
Author: User
Newbies don't know much about jquery, please do me a favor.
I wrote a temper.html page to call the contents of the http://hys2013.sinaapp.com/SQL.php page, I follow the online example how not to AH (page does not pop windows)
Temper.html:












http://hys2013.sinaapp.com/SQL.php:
 
  
$mysql = new Saemysql ();
$conn = mysql_connect (sae_mysql_host_m. ': '). Sae_mysql_port,sae_mysql_user,sae_mysql_pass);
if ($conn) {$action = "connection succeeded"; echo "document.write ('". $action. "'); n ";}
$sql = "Select * from ' temp ' WHERE id = (SELECT MAX (CAST (id as UNSIGNED)] from temp)";//The row that gets the maximum ID
$row = $mysql->getline ($sql);
foreach ($row as $key = $value)
{
$insert _id= $value;
BREAK;//currently requires only ID so you don't have to traverse all the values
}
echo $insert _id;

Ask the great God to see how it should be changed.
------Solution--------------------
Jquery.post The second parameter is an additional parameter, and the third parameter is the callback.
$.post ("http://hys2013.sinaapp.com/SQL.php" , '', function (data) {alert ("Data Loaded:" + data);});
------Solution--------------------
Grammar
Jquery.post (url,data,success (data, Textstatus, JQXHR), DataType)
Parameter description
URL required. Specifies which URL to send the request to.
Data is optional. The map or string value. Specifies the data that is sent to the server along with the request.
Success (data, Textstatus, JQXHR) is optional. The callback function to execute when the request succeeds.
DataType
Optional. Specifies the data type of the expected server response.
The default is to perform smart judgments (XML, JSON, script, or HTML).


No after line 8th!
Change to echo $row [' id '];

  • 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.