php 数据库的封装类
<?php
class DB
{
private $link;
function connectDB($dbhost, $dbuser, $dbpw, $dbname="", $pconnect = 1)
{
if($pconnect)
{
if(!$this->link = mysql_pconnect($dbhost, $dbuser, $dbpw))
{
$this->mysqlErrorMessage('Can not connect to MySQL');
}
}
else
{
if(!$this->link = mysql_connect($dbhost, $dbuser, $dbpw))
{
$this->mysqlErrorMessage('Can not connect to MySQL');
}
}
if(!empty($dbname))
{
mysql_select_db($dbname,$this->link);
}
mysql_query("set names 'gb2312'",$this->link);
}
function selectDB($dbName)
{
mysql_select_db($dbName,$this->link);
}
function query($sql)
{
if(!($query = mysql_query($sql,$this->link)))
{
$this->mysqlErrorMessage('SQL Error',$sql);
}
return $query;
}
function mysqlErrorMessage($errorTitle,$errorContent)
{
echo $errorTitle." : ".$errorContent."<br>";
}
function fetchArray($query)
{
return mysql_fetch_array($query);
}
function fetchObject($query)
{
return mysql_fetch_object($query);
}
function closeDB()
{
mysql_clos
相关文档:
有时候nginx,apache,mysql,php编译完了想看看编译参数可以用以下方法
nginx编译参数:
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_mo ......
//创建文件夹的方法
//$path 为文件夹参数,如 (c:/program files/makedir)
function createFolders($path) {
if (!file_exists($path)) {
$this->createFolders(dirname($path));
mkdir($path, 0777);
&n ......
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
PHPDocument是从你的源代码的注释中生成文档,因此在给你的程序做注释的过程,也就是你编制文档的过程。
从这一点上讲,PHPdoc促使你要养成良好的编程习惯,尽量使用规范,清晰文字为你的程序做注释,同时多多少少也避免了事后编制文档和文档的更新不同步的一些问题。
在phpdocumentor中,注释分为文档性注 ......
在以前的做的例子中遇到过重复的加载的错误 额 那个是通过include_once()来解决 或者不让他重复加载把重复的include()去掉一个或多个,最终只剩下一个这样问题就解决了,但今天遇到的问题就棘手了 说是找不到文件。
事情是这样的 ,今天在文件夹里再新建了一个文件夹,然后以前includ ......