PDA

View Full Version : دریافت خطا در درج رکورد در دیتابیس به صورت باین داینامیک پارامتر ها؟؟



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 تازه واردم
مرسی

sarapepors
یک شنبه 08 اردیبهشت 1392, 14:00 عصر
کسی نمیتونه کمکم کنه آیا ؟!

abolfazl-z
یک شنبه 08 اردیبهشت 1392, 16:40 عصر
http://www.php.net/manual/en/function.call-user-func-array.php

sarapepors
دوشنبه 09 اردیبهشت 1392, 10:06 صبح
مرسی از کمکتون ، مشکل از دستور sql بوده این کد ایرادی نداشته (: