#34828 [Bgs]: new mysqli_result($mysql); doesn't return expected instance
| From: | navin@php.net | Date: | Tue, 11 Oct 2005 13:54:46 +0000 |
| Subject: | #34828 [Bgs]: new mysqli_result($mysql); doesn't return expected instance | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86403@lists.php.net to get a copy of this message | ||
ID: 34828
User updated by: navin@php.net
Reported By: navin@php.net
Status: Bogus
Bug Type: MySQLi related
Operating System: Windows XP Pro SP2
PHP Version: 5.0.5
New Comment:
Oups, a mistake in my previous comment. I ment:
This works:
$mysql = new mysqli('localhost', 'root', '', 'test');
$result = $mysql->query("SELECT 'test'");
$row = $result->fetch_row();
And this doesn't:
$mysql = new mysqli('localhost', 'root', '', 'test');
$mysql->query("SELECT 'test'");
$result = new mysqli_result($mysql);
$row = $result->fetch_row();
---------------
$mysql->real_query('...'); is not relevant to this problem.
Previous Comments:
------------------------------------------------------------------------
[2005-10-11 15:29:36] tony2001@php.net
Use $mysql->real_query() if you want to create mysqli_result instance
yourself.
No bug here, that's how it works.
------------------------------------------------------------------------
[2005-10-11 15:12:29] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-10-11 15:10:14] navin@php.net
This works:
$mysql = new mysqli('localhost', 'root', '', 'test');
$mysql->query("SELECT 'test'");
$result = new mysqli_result($mysql);
$row = $result->fetch_row();
And this doesn't:
$mysql = new mysqli('localhost', 'root', '', 'test');
$result = $mysql->query("SELECT 'test'");
$row = $result->fetch_row();
------------------------------------------------------------------------
[2005-10-11 15:07:14] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-10-11 15:02:00] navin@php.net
Description:
------------
new mysqli_result($mysql); doesn't return expected instance
Reproduce code:
---------------
$mysql = new mysqli('localhost', 'root', '', 'test');
$mysql->query('SELECT * FROM
test');
$result = new mysqli_result($mysql);
$row = $result->fetch_row();
$result->close();
$mysql->close();
var_dump($row);
Expected result:
----------------
array
Actual result:
--------------
NULL
+ Warning messages:
Warning: Couldn't fetch mysqli_result in test.php on line 4
Warning: Couldn't fetch mysqli_result in test.php on line 6
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34828&edit=1