A
A
Andy12952015-10-13 20:29:59
PHP
Andy1295, 2015-10-13 20:29:59

What is wrong with mysqli query?

Where is the error in this code? The database query is not executed.
I tried to enter a request through phpMyAdmin, everything works, but here it doesn’t.

$value = serialize($value);
        
        $mysqli = new mysqli(DB_HOST,DB_LOGIN,DB_PASS,DB_NAME); 
        $q = $mysqli->prepare("UPDATE `settings` SET `value` = ? WHERE `name` = 'groups'");
        $q->bind_param("s",$value);
        $q->execute();
        $q->close();
        $mysqli->close();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivanq, 2015-10-13
@Ivanq

Please $q->execute();add after echo $mysqli->error;. Then the error text will be visible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question