我尝试用mysqli编写数据库类。但是我有问题。
我发送信息;
echo $db->gor("SELECT mail, yazar FROM uyeler where mail=? AND yetki=?",array('ss','test@test.com','2'));
这是我班的'功能;
function gor(){
$args = func_get_args();
if ($stmt = $this->durum->prepare($args['0'])) {
call_user_func_array(array($stmt, "bind_param"), $args['1']) ;
$stmt->execute();
$stmt->bind_result($mail, $writer);
$stmt->fetch();
echo $mail,' ', $writer,'<br>';
$stmt->close();
}else echo 'problem';
}
我需要什么?
$db->gor("SELECT mail, writer FROM member where mail=? AND permission=?",array('ss','test@test.com','2'));
当我写无变量或50个变量时,我添加;
$stmt->bind_param('sss',variable1,variable2,variable3);
自动添加s和变量。
$db->gor(this is querysection,array('ss // how much I need','I send variable1','variable2'));
等。抱我的英文,谢谢。