M
M
Mikhail Smirnov2022-03-24 18:35:19
PHP
Mikhail Smirnov, 2022-03-24 18:35:19

When changing values ​​in a table cell, the error mysqli_query () takes off: Couldn't fetch mysqli, where did I go wrong?

Trying to make changes to cells

$id=(int)$data['order_id'];
    $resultUpdate = mysqli_query($conn,"UPDATE `orderstat22` SET `status`='заказ оплачен'  WHERE `order_id`=$id");
mysqli_close($conn);

The error mysqli_query () takes off: Couldn't fetch mysqli
I can not figure out what it is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2022-03-24
@Mehannik

Couldn't fetch mysqli occurs if the database connection has already been closed.
There are such diligent lovers everywhere to shove mysqli_close
We must always beat them on the hands, and wean them from writing this meaningless line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question