php 在函数前面加个@的作用
@是PHP提供的错误信息屏蔽的专用符号。
比如在一个函数前使用@
@mysql_query 不会出现Warning,
而原来mysql_query 在遇到错误时会在页面上访提示Warning。
//更新、删除、添加记录数
function uidRst($sql){
if($this->conn == ''){
$this->init_conn();
}
@mysql_query($sql);
$this->rowsNum = @mysql_affected_rows();
if(mysql_errno() == 0){
return $this->rowsNum;
}else{
//return '';
return $this->msg_error();//TonnyLi Debug
}
}
@是PHP提供的错误信息屏蔽的专用符号。
比如在一个函数前使用@
@mysql_query 不会出现Warning,
而原来mysql_query 在遇到错误时会在页面上访提示Warning。
//更新、删除、添加记录数
function uidRst($sql){
if($this->conn == ''){
$this->init_conn();
}
@mysql_query($sql);
$this->rowsNum = @mysql_affected_rows();
if(mysql_errno() == 0){
return $this->rowsNum;
}else{
//return '';
return $this->msg_error();//TonnyLi Debug
}
}
版权声明:本站未标注作者的文章均为失落的羊原创文章,转载请注明出处!
最后编辑:2022-2-21 17:02:15
提示:本文章评论功能已关闭