AJax¼¼Êõ

PHP·ÃÎÊMySqlÊý¾Ý¿â ¸ß¼¶Æª AJAX¼¼Êõ(3)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2015-12-23 14:15 ÎÒÒªÆÀÂÛ( )

¸ù¾Ýidɾ³ýÊý¾Ý¿âÖÐÒ»ÐмǼ£¬³É¹¦·µ»Øf£¬Ê§°Ü·µ»Øt¡£ ?phprequire_once 'smarty2_head.php';//mysql_connect$conn = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(connect failed . mysql_error());mysql_sel

¸ù¾Ýidɾ³ýÊý¾Ý¿âÖÐÒ»ÐмǼ£¬³É¹¦·µ»Ø"f"£¬Ê§°Ü·µ»Ø"t"¡£

<?php require_once 'smarty2_head.php'; //mysql_connect $conn = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("connect failed" . mysql_error()); mysql_select_db(DB_DATABASENAME, $conn); //params $id = $_POST['id']; //delete row in db $sql = sprintf("delete from %s where id=%d", DB_TABLENAME, $id); $result = mysql_query($sql, $conn); mysql_close($conn); if ($result) echo "t"; else echo "f"; ?>

8£®ÐÂÔö¼ÓµÄupdata.php

¸ù¾ÝidÐÞ¸ÄÊý¾Ý¿âÖÐÒ»ÐмǼ£¬³É¹¦·µ»Ø"f"£¬Ê§°Ü·µ»Ø"t"¡£

<?php require_once 'smarty2_head.php'; //mysql_connect $conn = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("connect failed" . mysql_error()); mysql_select_db(DB_DATABASENAME, $conn); //params $id = $_POST['id']; $name = $_POST['name']; $age = $_POST['age']; //updata db $sql = sprintf("update %s set,age=%d where id=%d", DB_TABLENAME, $name, $age, $id); $result=mysql_query($sql, $conn); mysql_close($conn); if ($result) echo "t"; else echo "f"; ?>

³ÌÐòÔËÐнá¹ûÈçÏ£¨Win7 +IE9.0£©£º

 

±¾ÈËCSSѧµÄÌ«²Ë¡£ËùÒÔ±í¸ñµÄ²¼¾Ö½«¾ÍµãÁË¡£

 

תÔØÇë±êÃ÷³ö´¦£¬Ô­ÎĵØÖ·£º

 

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ajax¼¼ÇÉÖÆ×÷µÃÔÚÏ߸è´ÊËÑË÷¹¦Ð§

    ajax¼¼ÇÉÖÆ×÷µÃÔÚÏ߸è´ÊËÑË÷¹¦Ð§

    2016-02-06 14:47

  • ¿Í»§¶Ë·ÃÎÊwebservice»ù´¡

    ¿Í»§¶Ë·ÃÎÊwebservice»ù´¡

    2016-01-17 17:16

  • ÁªºÏÀûÓü¼ÇÉÏÈÈÝÖ®Ajax°²È«»ù´¡

    ÁªºÏÀûÓü¼ÇÉÏÈÈÝÖ®Ajax°²È«»ù´¡

    2015-11-22 17:25

  • ¡¾ExtJS4ѧϰ±Ê¼Ç03¡¿AjaxÔ¶³Ì·ÃÎÊÊý¾ÝԴʾÀý

    ¡¾ExtJS4ѧϰ±Ê¼Ç03¡¿AjaxÔ¶³Ì·ÃÎÊÊý¾ÝԴʾÀý

    2015-11-15 15:00

ÍøÓѵãÆÀ
Ç