hljmly

  jQuery实例的ajax应用之二级联动的后台是采用php来做的,前台通过jquery的ajax方式实现二级联动

  数据库表设计 csj_trade

  id int(11) auto_increment

  tname varchar(100)

  tradeType int(11)

  其中,id为主键自动索引,tname为行业名称,tradeType为一个标识,为0时,表示这条数据是大类;不为0,而是某个数字的时候,则这个数字表示其父级的id。

  (1)主页面http://rl.82676666.com

  ——所属行业大类——     $res1=result("select * from csj_trade where tradeType=0");   while($rs1=mysql_fetch_array($res1)){   ?>   ">————

  ——行业小类——

  (2)getstrade.php

  require_once("function.php");

  header("Cache-Control: no-cache");

  $id=verify_id($_GET["id"]);

  $res=result("select * from csj_trade where tradeType=".$id);

  $rt=\'\';   while($rs=mysql_fetch_array($res)){   $rt.=\'\'.$rs["tname"].\'\';   }   $rt.=\'\';

  echo $rt;

  ?>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2022-01-28
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
猜你喜欢
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2021-11-29
  • 2021-10-12
  • 2021-12-10
  • 2021-11-29
相关资源
相似解决方案