sarapepors
یک شنبه 08 اردیبهشت 1392, 10:14 صبح
public function insert_delete_update($sql,$type,$param){
$this->connector(1);
$stmt=mysqli_prepare($this->conn,$sql);
if ($type&&$sql){
$bind_names[]=$type;
for($i=0;$i<count($param);$i++){
$bind_name='bind'.$i;
$$bind_name=$param[$i];
$bind_names[]=&$$bind_name;}
call_user_func_array(array($stmt,'bind_param'),$bi nd_names);
mysqli_stmt_execute($stmt);
echo mysqli_stmt_affected_rows($stmt);
$this->connector(0);
}
}
خطا:call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object
اگه میشه کمک کنید من یک بار از این کد جواب گرفتم و موفق شدم که رکورد درج کنم اما حالا خطا داره تو php تازه واردم
مرسی
$this->connector(1);
$stmt=mysqli_prepare($this->conn,$sql);
if ($type&&$sql){
$bind_names[]=$type;
for($i=0;$i<count($param);$i++){
$bind_name='bind'.$i;
$$bind_name=$param[$i];
$bind_names[]=&$$bind_name;}
call_user_func_array(array($stmt,'bind_param'),$bi nd_names);
mysqli_stmt_execute($stmt);
echo mysqli_stmt_affected_rows($stmt);
$this->connector(0);
}
}
خطا:call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object
اگه میشه کمک کنید من یک بار از این کد جواب گرفتم و موفق شدم که رکورد درج کنم اما حالا خطا داره تو php تازه واردم
مرسی