Forum Moderators: open

Message Too Old, No Replies

MySQL database no longer returns data

         

lp intheend lp

3:51 pm on Jun 11, 2008 (gmt 0)

10+ Year Member



I recently moved one of my websites to another server and the MySQL queries no longer return any data from the database. I already made sure I changed the login / password etc. so everything should work but it doesn't. It looks like a connection is successfully made to the database and the table is accessed (there is data stored in it) but nothing is returned - I know 100% that there is nothing wrong with the query. Any ideas what could be causing this? By the way, I'm using PHP 5, Apache 2.2 and MySQL 5.

Thanks for any help you can provide.

rocknbil

5:31 pm on Jun 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard LP, do you have command line access?

select count(*) from tablename;

Will eliminate or finalize the DB as the culprit or indicate a problem with the scripts that access it.

lp intheend lp

6:47 pm on Jun 11, 2008 (gmt 0)

10+ Year Member



Thank you for your reply

I gave that a try and it returns the correct number. I'm looking through the script now for problems. It's strange that it works fine on the other server but not on this one.

Demaestro

6:55 pm on Jun 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Was the code written for an earlier version and you have moved it to a newer version? I know you said you are using MySQL 5 now but is that where the code came from? Also same for the PHP.... it is possible that something that worked in earlier versions has been deprecated in the newer version or the newer version could be more strict about some lax programming practice that the old version ignored.

Also if you execute the query from command line does it return the data? If so the issue is most likely in the PHP code rather then the query.

[edited by: Demaestro at 6:58 pm (utc) on June 11, 2008]

lp intheend lp

7:20 pm on Jun 11, 2008 (gmt 0)

10+ Year Member



Ok it works properly when I remove the != condition from the query. Does this not work in with MySQL 5?

lp intheend lp

7:23 pm on Jun 11, 2008 (gmt 0)

10+ Year Member



Demaestro - I was using MySQL 4.1 before - everything else has remained the same.

Demaestro

7:27 pm on Jun 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



!=.... this should work unless you are testing to see if it is != Null... if you are checking if it is null then you have to say "is Null" or "is not Null"

Other then that != should work