phpwind中的数据库操作类_php技巧_脚本之家

作者: 时时彩平台-编程  发布:2020-01-12

connect($dbhost,$dbuser,$dbpw,$dbname,$pconnect); } functionconnect($dbhost,$dbuser,$dbpw,$dbname,$pconnect=0){ $pconnect==0?@mysql_connect($dbhost,$dbuser,$dbpw):@mysql_pconnect($dbhost,$dbuser,$dbpw); mysql_errno()!=0&&$this->halttoMySQLfailed"); if>'4.1'&&$GLOBALS['charset']){ mysql_query("SETNAMES'".$GLOBALS['charset']."'"); } if>'5.0'){ mysql_query; } if{ if(!@mysql_select_db{ $this->halt; } } } functionclose(){ returnmysql_close(); } functionselect_db{ if(!@mysql_select_db{ $this->halt; } } functionserver_info(){ returnmysql_get_server_info(); } functionquery{ $GLOBALS['PW']=='pw_'or$SQL=str_replace('pw_',$GLOBALS['PW'],$SQL); if($method=='U_B'&&function_exists('mysql_unbuffered_query')){ $query=mysql_unbuffered_query; }else{ $query=mysql_query; } $this->query_num++; //echo$SQL.'
'.$this->query_num.'
'; if$this->halt; return$query; } functionget_one{ $query=$this->query; $rs=&mysql_fetch_array; return$rs; } functionpw_update{ $rt=$this->get_one{ $this->update; }else{ $this->update; } } functionupdate{ $GLOBALS['PW']=='pw_'or$SQL=str_replace('pw_',$GLOBALS['PW'],$SQL); if{ if=='REPLACE'){ $SQL=substr.'LOW_PRIORITY'.substr; }else{ $SQL=substr.'LOW_PRIORITY'.substr; } } if(function_exists('mysql_unbuffered_query')){ $query=mysql_unbuffered_query; }else{ $query=mysql_query; } $this->query_num++; //echo$SQL.'
'.$this->query_num.'
'; if$this->halt; return$query; } functionfetch_array($query,$result_type=MYSQL_ASSOC){ returnmysql_fetch_array; } functionaffected_rows(){ returnmysql_affected_rows(); } functionnum_rows{ $rows=mysql_num_rows; return$rows; } functionfree_result{ returnmysql_free_result; } functioninsert_id(){ $id=mysql_insert_id(); return$id; } functionhalt{ require_once(R_P.'require/db_mysql_error.php'); newDB_ERROR; } } ?>

本文由时时彩平台发布于时时彩平台-编程,转载请注明出处:phpwind中的数据库操作类_php技巧_脚本之家

关键词:

上一篇:没有了
下一篇:没有了