Doc #55823 [NEW]: mysqli::query with MYSQLI_STORE_RESULT returns TRUE on an INSERT statement
From:
Operating system: linux
PHP version: Irrelevant
Package: MySQLi related
Bug Type: Documentation Problem
Bug description:mysqli::query with MYSQLI_STORE_RESULT returns TRUE on an INSERT statement
Description:
------------
---
From manual page: http://www.php.net/mysqli.query
---
$results = $mysqli->query($sql_insert, MYSQLI_STORE_RESULT);
$results is TRUE
But,
$success = $mysqli->real_query($sql_insert);
$results = $mysqli->store_result();
$results is FALSE
This is in direct contradiction with the docs of mysqli::QUERY
"Functionally, using this function is identical to calling
mysqli_real_query() followed either by mysqli_use_result() or
mysqli_store_result()."
Test script:
---------------
$mysqli = new mysqli('localhost', 'test', 'test123',
'test');
$sql_insert = "INSERT test values (null,'aa')"; //test table has an
autoincrement ID column and a varchar(10) column
$success = $mysqli->real_query($sql_insert);
$results = $mysqli->store_result();
var_dump($results); // boolean false
$results = $mysqli->query($sql_insert, MYSQLI_STORE_RESULT);
var_dump($results); // boolean true
$mysqli->close();
Expected result:
----------------
expecting $mysqli->query($sql_insert, MYSQLI_STORE_RESULT) to return FALSE
Actual result:
--------------
$mysqli->query($sql_insert, MYSQLI_STORE_RESULT); returns TRUE
--
Edit bug report at https://bugs.php.net/bug.php?id=55823&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55823&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55823&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55823&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55823&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55823&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55823&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55823&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55823&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55823&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55823&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55823&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55823&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55823&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55823&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55823&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55823&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55823&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55823&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55823&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55823&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55823&r=mysqlcfg
Thread (2 messages)
- esaour at gmail dot com