php mysql_connect 与mysql_pconnect函数与实例教程
php教程 mysql教程_connect 与mysql_pconnect函数与实例教程
mysql_connect
mysql_connect($this->root,$this->user,$this->pass)
/*
mysql_connect ,单个反问用户不会频繁的调用数据库教程,没必要保持连接,而且mysql的连接数也是有限制的, 使用 及时访问比较频繁,也最好使用mysql_connect,这样使用的过的资源可以立刻释放,否则,容易造成资源耗
*/
mysql_pconnect
/*
mysql_pconnect() 函数打开一个到 MySQL 服务器的持久连接
*/
$con = mysql_pconnect("localhost","mysql_user","mysql_pwd");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
class testLinkMysql{
public $conn;
public $root='localhost';
public $user='root';//'loupan';
public $pass='root';//'loupandsffds';
public $db='dbname';
public $charset='gbk';
public $links='c'; //标题
function __construct() {
if( !$this->conn )
{
$this->connect();
}
}
function __destruct() {
if( $this->conn )
{
$this->close();
}
}
function MysqlConnect()
{
try{
if( 'p' == $this->links )
{
$this->conn = mysql_pconnect($this->root,$this->user,$this->pass) or die(mysql_error());
}
else
{
$this->conn = mysql_connect($this->root,$this->user,$this->pass) or die( mysql_error());
}
mysql_select_db($t
相关文档:
启动mysql的服务经常发现1067这个错误。查看事件日志以后发现下面的错误信息
Unknown/unsupported table type: INNODB
如何解决:在mysql数据存放目录下找到 ibdata 以及ib_logfile0、ib_logfile1删掉再启动就好了 ......
关于PHP的前途(二) (来自本站的消息)
3.2在Windows 95/98/NT/2000上快速安装Apache Web服务器(10秒钟)
在Windows上运行PHP,你需要一个Web服务器,你可以使用微软的IIS,也可以使用免费的Apache 。因为可以通过Apache的安装文件setup.exe进行安装,可以为你节省许多时间。
PHPTtriad是一个包括Apache、PHP、MySQ ......
编译安装
apache
下载apache安装
=============================
我把他安装在/usr/local/apache目录下
tar -zxvf apache文件
进入解压后的目录,配置./configure --prefix=/usr/local/apache -enable-mods-shared=all -enable-so -enable-rewrite
make
make install
然后启动/usr/local/apache/bin/apachectl sta ......
标题有点长,其实就是用来向https服务器post数据
function curlPost($url, $data, $timeout = 30)
{
$ssl = substr($url, 0, 8) == "https://" ? TRUE : FALSE;
$ch = curl_init();
$opt = array(
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_ ......