$db = new mysqli('localhost','x','x','rock');
$q = $db->query("INSERT INTO names (name,surname) VALUES ('jack','daniel')");
var_dump($q); // boolean true
echo $db->info;
doing everything as described in manual but still returns nothing.
If the insert statement is one of the below info function will return result
INSERT INTO...SELECT...
INSERT INTO...VALUES (...),(...),(...)
And your insert is not satisfying this condition.
you have
INSERT INTO names (name,surname) VALUES ('jack','daniel')
if you change this to insert more than one record you will see the result from info function
if you change your insert query to insert multiple record in once you will get result
Try with below
INSERT INTO names (name,surname) VALUES ('jack','daniel'),('jack2','daniel2')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With