ID:               30896
 Updated by:       [EMAIL PROTECTED]
 Reported By:      niklas dot lampen at publico dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQLi related
 Operating System: Linux Debian
 PHP Version:      5.0.2
 New Comment:

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" 
} 


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to