After entering multiple lines with a single insert statement, I get the expected behavior from $ mysqli-> info.
var_dump( $mysqli->info );
string 'Records: 1246 Duplicates: 0 Warnings: 0' (length=41)
After inserting one row, $ mysqli-> info returns NULL
var_dump( $mysqli->info );
null
var_dump( $mysqli->affected_rows );
int 1
mysqli_info () returns an empty string
var_dump( mysqli_info( $mysqli ) )
string '' (length=0)
I can not find a link to this behavior! I would expect information after one insert, for example
string 'Records: 1 Duplicates: 0 Warnings: 0' (length=38)
PHP 5.4.12, mySQL 5.6.12
Executed code:
$sql = "INSERT INTO module_history (BackupDate, Modules) VALUES ('2014-01-01','Module List1')";
$db->query($sql);
echo $sql . "\n";
var_dump( $db->info );
var_dump( $db->affected_rows );
$sql = "INSERT INTO module_history (BackupDate, Modules) VALUES ('2014-01-02','Module List2'),('2014-01-03','Module List3')";
$db->query($sql);
echo $sql . "\n";
var_dump( $db->info );
var_dump( $db->affected_rows );
Results:
INSERT INTO module_history (BackupDate, Modules) VALUES ('2014-01-01','Module List1')
null
int 1
INSERT INTO module_history (BackupDate, Modules) VALUES ('2014-01-02','Module List2'),('2014-01-03','Module List3')
string 'Records: 2 Duplicates: 0 Warnings: 0' (length=38)
int 2
source
share