易截截图软件、单文件、免安装、纯绿色、仅160KB

php 连接数据库的类

<?php
class Access//Access数据库操作类
{
var $databasepath,$constr,$dbusername,$dbpassword,$link;//类的属性
function Access($databasepath,$dbusername,$dbpassword)//构造函数
{
$this->databasepath=$databasepath;
$this->username=$dbusername;
$this->password=$dbpassword;
$this->connect();
}

function connect()//数据库连接函数
{
$this->constr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath($this->databasepath);
$this->link=odbc_connect($this->constr,$this->username,$this->password,SQL_CUR_USE_ODBC);
return $this->link;
//if($this->link) echo "恭喜你,数据库连接成功!";
//else echo "数据库连接失败!";
}

function query($sql)//送一个查询字符串到数据库中
{
return @odbc_exec($this->link,$sql);
}

function first_array($sql)//从access数据库中返回一个数组
{
return @odbc_fetch_array($this->query($sql));
}

function fetch_row($query)//返回记录中的一行
{
return odbc_fetch_row($query);
}

function total_num($sql)//取得记录总数
{
return odbc_num_rows($this->query($sql));
}

function close()//关闭数据库连接函数
{
odbc_close($this->link);
}

function insert($table,$field)//插入记录函数
{
$temp=explode(',',$field);
$ins='';
for ($i=0;$i<count($temp);$i++)
{
$ins.="'".$_POST[$temp[$i]]."',";
}
$ins=substr($ins,0,-1);
$sql="INSERT INTO ".$table." (".$field.") VALUES (".$in


相关文档:

伪静态URL重写技术实现方法 php asp

伪静态用到知识很简单一旦学会,快乐无穷,只需要正则和服务器设置。
  先说iis如何设置吧,往下看
  下载(IIS Rewrite模块): http://www.isapirewrite.com/,先把产品下载下来,安装在服务器上,记住目录,会有类似Rewrite.dll的文件生成,MMC→IIS信息服务管理器→网站→您的站点→属性,在“ ......

PHP的安装以及配置

安装以及配置
1.       安装Apache-2.2.4(Apache_Dir=D:\myspace\Apache-2.2.4)
2.       解压安装PHP-5.2.11(PHP_Dir=D:\myspace\PHP-5.2.11)
3.       找到PHP-5.2.11下的php.ini-dist,改名为php.ini
4.  &nb ......

PHP中的魔术方法

PHP中有下列称之为魔术方法(magic method)的函数:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,本文使用__call为实现一个身份验证的简单实例,代码如下: 代码<?php
    interfa ......

PHP开发工程师岗位职责与任职要求

岗位职责
互联网相关产品开发,项目开发,系统维护等
 
任职要求
1. 精通PHP开发语言,熟悉面向对象的软件设计方法;
2. 熟悉Unix/Linux操作系统,熟悉C/C++编程,熟悉Shell脚本编程及常用Unix管理命
   令,熟悉bash/python/perl;
3. 熟悉HTTP协议及W3C相关互联网规范,熟练掌握XHTML、CSS、 ......

PHP IP函数

<?php
$start = ip2long('192.168.1.1');
$start = sprintf("%u", $start) ;
$end = ip2long('192.168.1.50');
$end = sprintf("%u", $end) ;
for ($start; $start<$end; $start++){
echo long2ip($start)."<br>";
}
?> ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号