Answer the question
In order to leave comments, you need to log in
How to show mysqli_query result?
Hello.
There is php 5.4
There was such a problem, you need to show the result of mysqli_query and UPDATE.
There was code in PHP 5.2:
$result = $db->query("UPDATE `table` SET `tb1`='$test' ");
if ($result == TRUE) {echo "Обновлено";} else {echo "Не обновлено";}
function query($query, $show_error=true)
{
$time_before = $this->get_real_time();
if(!$this->db_id) $this->connect(DBUSER, DBPASS, DBNAME, DBHOST);
if(!($this->query_id = mysqli_query($this->db_id, $query) )) {
$this->mysql_error = mysqli_error($this->db_id);
$this->mysql_error_num = mysqli_errno($this->db_id);
if($show_error) {
$this->display_error($this->mysql_error, $this->mysql_error_num, $query);
}
}
$this->MySQL_time_taken += $this->get_real_time() - $time_before;
'num' => (count($this->query_list) + 1));
$this->query_num ++;
return $this->query_id;
}
Answer the question
In order to leave comments, you need to log in
In an amicable way, for a start it is necessary to result the text of an error. But here at least one mistake is visible to the naked eye. I’ll hint: where did it come from and what does this line of code mean:
'num' => (count($this->query_list) + 1));
What have you already tried to do? “Here is the code, fix it for me” is not very polite.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question