taşındı MySQL sorgusu ile ilgili komutPHP MySQL önemli hata sonra ben localhost Uygulamamı test edilmiş ve çok iyi çalışıyor olması gerçek sunucuya
class Test {
public function check_duplicate_username($username, $mysqli)
{
$sql = $mysqli->prepare("SELECT username FROM `account` WHERE username=?");
$sql->bind_param('s', $username); // line 44
$sql->execute();
$res = $sql->get_result();
if($res->num_rows !== 0){
return false;
}
return true;
}
public function get_main_cate($mysqli)
{
$sql = $mysqli->query("SELECT name FROM `category` ORDER BY `id` DESC");
if($sql->num_rows > 0){
return $sql;
}else{
return false;
}
}
}
sonucunu almak için, ölecek :
PHP Fatal error: Call to a member function bind_param() on boolean in /path/to/html/root/classes/test.php on line 44
[24-Mar-2016 02:36:26 America/Chicago] PHP Fatal error: Call to a member function fetch_object() on boolean in /path/to/html/root/sign-up.php on line 134
bu konuda neyi var: hata günlükten
$test = new Test;
if(!$test->check_duplicate_username($email, $mysqli)){
$data['error']['email'] = 'email has been used';
}
echo '<select>';
$cat = $test->get_main_cate($mysqli);
while($obj = $cat->fetch_object()){ //line 134
echo '<option>'.$obj->name.'</option>';
}
echo '</select>';
? Bu sebepten sunucudaki kütüphane eksik mi? Localhost içinde Sürüm 5.6.19 iken hosting PHP, Sürüm 5.6.18 olduğunu.
Hayır şans, ben ilk o zaman Ayrıca http://php.net/manual/en kullanılan olabilir bana – kefoseki
olmadığını düşünüyorum Hataları görmek için /mysqli-stmt.error-list.php –
söylemek deneyin alıntı sorunu –