|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-09 15:16 UTC] uw@php.net
-Status: Open
+Status: Feedback
[2011-05-09 15:16 UTC] uw@php.net
[2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 06:00:01 2025 UTC |
Description: ------------ i develop webapps in PHP OOP and mysql using mysqli library. this very simple query SELECT * FROM fornitori ORDER BY ragSociale works ok on localhost on my PC (Windows 7 Pro x64, apache 2.2.17-PHP 5.3.5-MySQL 5.1.55) but on my VPS (centOS 5.5, apache 2.2.16-PHP 5.3.2-MySQL 5.1.48) doesnt'work! in fact i have crerated a PHP function classes to use databases and in some of these i use the following code to check errors: echo $this->message('Query Error: ' . $mysqli->errno . '\nQuery: ' . $sql . '\n\nError: ' . $mysqli->error); while in localhost tehre isn't any error on my VPS i have teh following error: Query Error: Query: SELECT * FROM fornitori ORDER BY ragSociale Error: without any sort of error description. on other web server where i have a site (apache 2.2.16-PHP 5.2.13-MySQL 5.1.51) there isn't any error! so i think: is this a bug of PHP 5.3 using MySQLi ???? Test script: --------------- function arrayRecords($sql) { $mysqli = new mysqli($this->host, $this->user, $this->pass, $this->data); if ($mysqli) { $result = $mysqli->query($sql); if ($result) { if ($result->num_rows) { while ($row = $result->fetch_assoc()) $array[] = $row; } else $array = array(); } else echo $this->message('Query Error: ' . $mysqli->errno . '\nQuery: ' . $sql . '\n\nError: ' . $mysqli->error); } else echo $this->message('DB Connect Error: ' . $mysqli->connect_errno . '\nError: ' . $mysqli->connect_error); //$result->close(); $mysqli->close(); return $array; } // with PHP 5.2 works, with PHP 5.3 error! $rows = $arrayRecords($sql_query); Expected result: ---------------- nothing, it must show a window with the query results