php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49573 Mysqli_info doesn't return results when using INSERT .. values
Submitted: 2009-09-16 21:12 UTC Modified: 2009-09-17 07:13 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: terryllong at gmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.3.0 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: terryllong at gmail dot com
New email:
PHP Version: OS:

 

 [2009-09-16 21:12 UTC] terryllong at gmail dot com
Description:
------------
Mysqli_info doesn't seem to return results 
when using INSERT .. values

Reproduce code:
---------------
<?php
$link = mysqli_connect( 'host,'un', 'pw' ) or  die("Connect to db didn't work..."); $crlf=chr(13) .chr(10);
$test = mysqli_query($link, "CREATE DATABASE IF NOT EXISTS test") or die("Create db didn't work...");
$test = mysqli_query($link, "USE test") or die("Use TEST db didn't..");
$test = mysqli_query($link, "CREATE TEMPORARY TABLE IF NOT EXISTS t1 (city varchar(30))") or die("Create Temp Table didn't work...");
$data = mysqli_query($link, "INSERT INTO t1 (city) VALUES ('Tulsa')") or die("Insert data didn't work...");
$info_from_insert = mysqli_info($link);
print_r("mysqli_info values from 'INSERT' =  $info_from_insert $crlf");
print_r("Var_Dump of mysqli_info = ");
var_dump($info_from_insert);
print_r("---------$crlf");
$data= mysqli_query( $link , "SELECT CITY FROM  t1 " ) or die("Select statement didn't...");
$rows = mysqli_affected_rows($link); echo "Rows 'Affected' = $rows $crlf"; //- Get number of affected rows in previous MySQL operation
$select_info = mysqli_info($link);
print_r("select info:  $select_info $crlf");
print_r("Var_Dump of mysqli_info = ");
var_dump($info_from_insert);   echo $crlf;
$mysqli_test = mysqli_fetch_all($data, MYSQLI_ASSOC) ; echo "results from mysqli_fetch_all..$crlf";
var_dump($mysqli_test);
?>


Expected result:
----------------
Expect text string show the results of the insert.


Actual result:
--------------
Results of Insert query returns a string(0) as shown with a Var_dump

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-16 23:15 UTC] uw@php.net
It could be a bogus bug because: "Note that mysql_info() returns a non-NULL value for INSERT ... VALUES only for the multiple-row form of the statement (that is, only if multiple value lists are specified)", http://dev.mysql.com/doc/refman/5.1/en/mysql-info.html 

Please check what happens for the statements listed in the MySQL manual.

 [2009-09-17 07:13 UTC] uw@php.net
I checked the tests. They cover all supported statements and they pass. 

If you want mysqli_info() to support more than the statements listed in the MySQL documentation, please file a feature request at bugs.mysql.com.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 04:01:29 2024 UTC