#30896 [Csd->Bgs]: mysql(i)_fetch_*() fails on "SELECT * FROM t"

From: Date: Fri, 26 Nov 2004 09:54:46 +0000
Subject: #30896 [Csd->Bgs]: mysql(i)_fetch_*() fails on "SELECT * FROM t"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-69471@lists.php.net to get a copy of this message
ID: 30896 Updated by: tony2001@php.net Reported By: niklas dot lampen at publico dot com -Status: Closed +Status: Bogus Bug Type: MySQLi related Operating System: Linux Debian PHP Version: 5.0.2 New Comment: No bug -> bogus. Previous Comments: ------------------------------------------------------------------------ [2004-11-26 09:18:14] niklas dot lampen at publico dot com It seems to work just fine now. I can't reproduce the error anymore even with the very same code I found this "bug". I have not updated php nor mysql nor anything else on the box. Sorry for the mistaken bug report. ------------------------------------------------------------------------ [2004-11-25 18:06:33] georg@php.net Can't repeat. Could you test the following script please: <?php $mysql = new mysqli("localhost", "user", "password", "test"); printf("Client-Version: %s\n", $mysql->client_version); printf("Server-Version: %s\n", $mysql->server_version); $mysql->query("DROP TABLE IF EXISTS f"); $mysql->query("CREATE TABLE f (f char(4), f2 char(4), f3 char(4), f4 char(4))"); $mysql->query("INSERT INTO f VALUES ('data', 'data', 'data', 'data')"); $result = $mysql->query("SELECT * FROM f ORDER BY f"); $row = $result->fetch_object(); var_dump($row); ?> Output: Client-Version: 40108 Server-Version: 40108 object(stdClass)#3 (4) { ["f"]=> string(4) "data" ["f2"]=> string(4) "data" ["f3"]=> string(4) "data" ["f4"]=> string(4) "data" } ------------------------------------------------------------------------ [2004-11-25 11:05:14] niklas dot lampen at publico dot com Description: ------------ Fetching rows fail on both mysql_() and mysqli_() when query is simple "SELECT *". Not working: "SELECT * FROM t ORDER BY f" Working: "SELECT * FROM t WHERE 1=1 ORDER BY f" "SELECT * FROM t ORDER BY f LIMIT n" "SELECT f, f2, f3, f4 FROM t ORDER BY f" Reproduce code: --------------- $Res = mysql_query("SELECT * FROM t ORDER BY f", $Conn); $R = mysql_fetch_object($Res); var_dump($R); Expected result: ---------------- object(stdClass)#2 (4) { ["f"]=> string(4) "data" ["f2"]=> string(4) "data" ["f3"]=> string(4) "data" ["f4"]=> string(4) "data" } Actual result: -------------- object(stdClass)#2 (2) { ["@"]=> string(8) "#CERT11#" [""]=> string(0) "" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30896&edit=1

« previous php.bugs (#69471) next »