首页 > phper

php连接mysql数据库

mysql_affected_rows: 得到 mysql 最后操作影响的列数目。
mysql_close: 关闭 mysql 伺服器连线。
mysql_connect: 开启 mysql 伺服器连线。
mysql_create_db: 建立一个 mysql 新资料库。
mysql_data_seek: 移动内部传回指标。
mysql_db_query: 送查询字串 (query) 到 mysql 资料库。
mysql_drop_db: 移除资料库。
mysql_errno: 传回错误讯息代码。
mysql_error: 传回错误讯息。
mysql_fetch_array: 传回阵列资料。
mysql_fetch_field: 取得栏位资讯。
mysql_fetch_lengths: 传回单列各栏资料最大长度。
mysql_fetch_object: 传回物件资料。
mysql_fetch_row: 传回单列的各栏位。
mysql_field_name: 传回指定栏位的名称。
mysql_field_seek: 设定指标到传回值的某栏位。
mysql_field_table: 获得目前栏位的资料表 (table) 名称。
mysql_field_type: 获得目前栏位的型态。
mysql_field_flags: 获得目前栏位的旗标。
mysql_field_len: 获得目前栏位的长度。
mysql_free_result: 释放传回占用记忆体。
mysql_insert_id: 传回最后一次使用 insert 指令的 id。
mysql_list_fields: 列出指定资料表的栏位 (field)。
mysql_list_dbs: 列出 mysql 伺服器可用的资料库 (database)。
mysql_list_tables: 列出指定资料库的资料表 (table)。
mysql_num_fields: 取得传回栏位的数目。
mysql_num_rows: 取得传回列的数目。
mysql_pconnect: 开启 mysql 伺服器长期连线。
mysql_query: 送出一个 query 字串。
mysql_result: 取得查询 (query) 的结果。
mysql_select_db: 选择一个资料库。
mysql_tablename: 取得资料表名称。

阅读全文

js 树形菜单(php ajax可刷新)

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.phprm.com/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>simpletree drag</title>
<style>
body
{
 font: normal 12px arial, tahoma, helvetica, sans-serif;
 margin:0;
 padding:20px;
}
.simpletree
{
 
 margin:0;
 padding:0;
 /*
 overflow:auto;
 width: 250px;
 height:350px;
 overflow:auto;
 border: 1px solid #444444;
 */
}
.simpletree li
{
 list-style: none;
 margin:0;
 padding:0 0 0 34px;
 line-height: 14px;
}
.simpletree li span
{
 display:inline;
 clear: left;
 white-space: nowrap;
}
.simpletree ul
{
 margin:0;
 padding:0;
}
.simpletree .root
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/root.jpg) no-repeat 16px 0 #ffffff;
}
.simpletree .line
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-last
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/spacer.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-over
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg_over.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-over-last
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg_over_last.jpg) 0 0 no-repeat transparent;
}
.simpletree .folder-open
{
 margin-left:-16px;
 background: url(images/collaps教程able.gif) 0 -2px no-repeat #fff;
}
.simpletree .folder-open-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/collapsable-last.jpg) 0 -2px no-repeat #fff;
}
.simpletree .folder-close
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/expandable.jpg) 0 -2px no-repeat #fff;
}
.simpletree .folder-close-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/expandable-last.jpg) 0 -2px no-repeat #fff;
}
.simpletree .doc
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/leaf.jpg) 0 -1px no-repeat #fff;
}
.simpletree .doc-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/leaf-last.jpg) 0 -1px no-repeat #fff;
}
.simpletree .ajax
{
 background: url(http://pic3.phprm.com/2010/10/16/spinner.jpg) no-repeat 0 0 #ffffff;
 height: 16px;
 display:none;
}
.simpletree .ajax li
{
 display:none;
 margin:0;
 padding:0;
}
.simpletree .trigger
{
 display:inline;
 margin-left:-32px;
 width: 28px;
 height: 11px;
 cursor:pointer;
}
.simpletree .text
{
 cursor: default;
}
.simpletree .active
{
 cursor: default;
 background-color:#f7be77;
 padding:0px 2px;
 border: 1px dashed #444;
}
#drag_container
{
 background:#ffffffwww.phprm.com;
 color:#000;
 font: normal 11px arial, tahoma, helvetica, sans-serif;
 border: 1px dashed #767676;
}
#drag_container ul
{
 list-style: none;
 padding:0;
 margin:0;
}

阅读全文

php ajax分页代码

header("content-type: text/html;charset=gbk");//输出编码,避免中文乱码
?>
<html>
<head>
<title>ajax分页演示</title>
<script language="网页特效" >
var http_request=false;
  function send_request(url){//初始化,指定处理函数,发送请求的函数
    http_request=false;
 //开始初始化xmlhttprequest对象
 if(window.xmlhttprequest){//mozilla浏览器
  http_request=new xmlhttprequest();
  if(http_request.overridemimetype){//设置mime类别
    http_request.overridemimetype("text/xml");
  }
 }
 else if(window.activexobject){//ie浏览器
  try{
   http_request=new activexobject("msxml2.xmlhttp");
  }catch(e){
   try{
   http_request=new activexobject("microsoft.xmlhttp");
   }catch(e){}
  }
    }
 if(!http_request){//异常,创建对象实例失败
  window.alert("创建xmlhttp对象失败!");
  return false;
 }
 http_request.onreadystatechange=processrequest;
 //确定发送请求方式,url,及是否同步执行下段代码
    http_request.open("get",url,true);
 http_request.send(null);
  }
  //处理返回信息的函数
  function processrequest(){
   if(http_request.readystate==4){//判断对象状态
     if(http_request.status==200){//信息已成功返回,开始处理信息
   document.getelementbyid(reobj).innerhtml=http_request.responsetext;
  }
  else{//页面不正常
   alert("您所请求的页面不正常!");
  }
   }
  }
  function dopage(obj,url){
   document.getelementbyid(obj).innerhtml="<font color='green' font-size='12'>正在读取数据...</font>";
   send_request(url);
   reobj=obj;
   }
 
</script>
<style>
/* css教程 document */
#result ul li{
 height:20px;
 width:auto;
 display:block;
 color:#999;
 border:1px solid #999;
 float:left;
 list-style:none;
 font-size:12px;
 margin-left:5px;
 line-height:20px;
 vertical-align:middle;
 text-align:center;
 }
#result ul li a:link{
 width:50px;
 height:20px;
 display:block;
 
 line-height:20px;
 background:#09c;
 border:1px solid #fff;
 color:#fff;
 text-decoration:none;
 }
#result ul li a:hover{
 width:50px;
 height:20px;
 display:block;
 
 line-height:20px;
 background:#09c;
 border:1px solid #fff;
 color:#f60;
 text-decoration:none;
 }
</style>
</head>
<body>
<div id="result">
<?php
$page=isset($_get['page'])?intval($_get['page']):1;        //这句就是获取page=18中的page的值,假如不存在page,那么页数就是1。
$num=10;                                      //每页显示10条数据

阅读全文