兼容php版本,加在文件中即可
< ? php
if(!function_exists('mysql_connect')){
function mysql_connect($host,$user,$passwd){
return mysqli_connect($host,$user,$passwd,'ecshop');
}
function mysql_select_db($dbname){
return true;
}
function mysql_errno($cxn=null){
return mysqli_errno($cxn);
}
function mysql_error($cxn=null){
return mysqli_error($cxn);
}
function mysql_fetch_array($result){
return mysqli_fetch_array($result);
}
function mysql_fetch_assoc($result){
return mysqli_fetch_assoc($result);
}
function mysql_fetch_row($result){
return mysqli_fetch_row($result);
}
function mysql_insert_id($cxn){
return mysqli_insert_id($cxn);
}
function mysql_num_rows($result){
return mysqli_num_rows($result);
}
function mysql_query($sql,$cxn){
return mysqli_query($cxn,$sql);
}
function mysql_real_escape_string($data){
return mysqli_real_escape_string($cxn,$data);
}
function mysql_get_server_info($cxn){
return mysqli_get_server_info($cxn);
}
function mysql_ping($cxn){
return mysqli_ping($cxn);
}
}