mysqli_info(): additional info on query

mysqli_info ( mysqli $link ) 
$mysqli : database connection string or Link

Output of this function is ( string ) information about the most recently executed query
QueryPossible mysqli_info return values
INSERT INTO `student_max` (`id`, `name`, `class`, `mark`, `sex`) VALUES (35, 'John Alex', 'Five', 80, 'male'), (35, 'John Alex', 'Five', 80, 'female')Records: 2 Duplicates: 0 Warnings: 0
INSERT INTO student_max SELECT * from studentRecords: 35 Duplicates: 0 Warnings: 0
LOAD DATA INFILE ...Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
ALTER TABLE `student_max` CHANGE `id` `id` INT( 3 ) NOT NULL DEFAULT '0'Records: 0 Duplicates: 0 Warnings: 0
UPDATE `student_max` set mark=mark+2Rows matched: 35 Changed: 35 Warnings: 0

PHP Script

//$query="INSERT INTO student_max SELECT * from student ";
/*$query ="INSERT INTO `student_max` (`id`, `name`, `class`, `mark`, `sex`) VALUES
(35, 'John Alex', 'Five', 80, 'male'),
(35, 'John Alex', 'Five', 80, 'female')";
//$query ="ALTER TABLE  `student_max` CHANGE  `id`  `id` INT( 4 ) NOT NULL DEFAULT  '0'";
$query ="UPDATE   `student_max` set mark = mark+2";
echo "
No of records inserted : ".$connection->affected_rows;
echo $connection->error;
echo "<br>";
echo $connection->info;
Rows matched: 35 Changed: 35 Warnings: 0
The above output is based on query UPDATE `student_max` set mark = mark+2 You can try other queries.
MYSQLI Functions mysqli_update() Update Records
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 All rights reserved worldwide Privacy Policy Disclaimer