Use Ajax to view people information on data

Source: Internet
Author: User
Tags button type

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Sub-page: 123123. Php

Convert the symbol letters you want to display into Chinese characters.

<?phpinclude ("DBDA.class.php"), $db = new Dbda (), $sql = "SELECT * from Info", $attr = $db->query ($sql); for ($i =0; $i & Lt;count ($attr), $i + +) {$attr [$i][2]= $attr [$i][2]? " Male ":" female "; $sqll =" SELECT name from Nation where code = ' {$attr [$i][3]} ' "; $de = $db->query ($SQLL); $attr [$i][3] = $de [0][ 0];} n001^ han |n002^ hui $str = ""; foreach ($attr as $v) {$str. =implode ("^", $v). "|";} echo $str; Echo substr ($str, 0,strlen ($STR)-1);

Sub-page: 123124.php

? PHP
include ("DBDA.class.php");
$db = new Dbda ();

$code = $_post["code"];
$sql = "SELECT * from info where code= ' {$code} '";

$attr = $db->query ($sql);


     $attr [0][2]= $attr [0][2]? " Male ":" Female ";
     $SQLL = "SELECT name from Nation where code = ' {$attr [0][3]} '";
     $de = $db->query ($SQLL);
     $attr [0][3] = $de [0][0];
     $STR = "";
            foreach ($attr as $v)
            {
                 $str. = Implode ("^", $v). "|";
            }
            
            echo substr ($str, 0,strlen ($STR)-1);

Here is the result of the run

Use Ajax to view people information on data

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.