April 12, 2012

mysql bug database error

Question by vvavepacket

Why is that when I search a row in my database, it ended up 0 results? In fact, there are rows that meet my search criterion when I view them manually, but the search button doesnt work as it is. Heres how

enter image description here

you can see there are rows that have ‘0000-00-00 00:00:00’ in them, but when I used the search feature, it ended up like this:

enter image description here

take note that Im entering it in the right field which is ‘AcctStopTime’.

TIA

Answer by ascii-lime

You’re searching with LIMIT 30 , 30.

That will cause there to be no results if there as less than 30 results total. Try LIMIT 0 , 30 instead.

Answer by Starx

If you analyze your query, you can see LIMIT 30, 30.

What it says is, extract 30 rows, from the 30th position. So, if you do not have any records more than or beyond 30, then your query will return an empty set.

Next thing you might want to check is the WHERE condition

If the given values does not match any field it will not return any records also.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!