Hello!

i have a very simple query:

SELECT * FROM fornitori ORDER BY ragSociale

this works perfectly in localhost on my PC (windows 7 pro-apache 2.2.17-mysql 5.1.54-PHP 5.3.4) but on my VPS doesn't work and it give me a query error without number or error description (VPS: centOS 5.5-apache 2.2.16-mysql 5.1.48-PHP 5.3.2) !!!! why????

Recommended Answers

All 7 Replies

Use the mysql command line interface to get at the error message. Or use the mysql_error() function in PHP.
Check upper/lower case in table names.

Use mysql_error() to display an error with PHP. Or run this query in phpMyAdmin or MySQL command. Post the error message here for more help.

Does this table exist on your VPS?

i have used mysqli and i have added this line (using PHP OOP) to check what to do when there is an error (into a class function):

echo $this->message('Query Error: ' . $mysqli->errno . '\nQuery: ' . $sql . '\n\nError: ' . $mysqli->error);

which shows all the information on errors. while in localhost it's all ok on my VPS i receive this error:

/---------------------------------------------------\
|Query Error: |
|Query: SELECT * FROM fornitori ORDER BY ragSociale |
| |
|Error: |
\----------------------------------------------------/

i have also tried the query in phpmyadmin in localhost and on VPS and both the query works!!!!

Use mysql_error() or the mysql command line interface to get at the error.

It means there is no problem with the query. The problem may be the way you are displaying results.

It means there is no problem with the query. The problem may be the way you are displaying results.

it can be..but why it happens only on the VPS? i have checked the character set too, both are in utf8_generali_ci

incredible..i have tried the webapp using this script on a web server online with PHP 5.2.14 and MySQL 5.1.48 and it works!!! perhaps there is some bug in the PHP 5.3 and mysqli ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.