0

Well this is an odd thing for sure. Am using MySQL to display a series of alerts, and the query I'm using separates by way of what level the alert is. The table has five columns, but the one being used here is the level column (alert level: 1 - normal; 2 - moderate; 3 - high). ID is used to only display the oddity with the query.

The weird thing is when I run this query, it displays normally:

SELECT * FROM `alerttxt` ORDER BY level ASC

It loses an entry on the web page when I switch the order, but shows all the rows in PHPMyAdmin...which is odd itself:

SELECT * FROM `alerttxt` ORDER BY level DESC

But the minute I add in an extra element:

SELECT * FROM `alerttxt` WHERE level = '2' ORDER BY ID ASC

Things go haywire. I ran this same query in PHPMyAdmin, also using ORDER BY ID DESC, and the return was as follows:

    Showing rows 0 - -1

I've never seen this before and am not quite sure how to fix it. Anyone else seen this before and be able to fix it? Thanks, all!

Added 8/31/12 - for grumpy

ID  level   system     status                           restoretime
0   2       MyISU      System is functioning normally   NULL
1   2       Network    System is functioning normally   NULL
2   1       Blackboard System is functioning normally   NULL
3   3       Email      System is functioning normally   NULL
4   1       Banner     System is functioning normally   NULL

and the structure:

Column      |  Type         | Null  |  Default
-----------------------------------------------------------------
ID             int(11)        No         
level          varchar(3)     No       1     
system         varchar(255)   No         
status         varchar(755)   No       System is functioning normally    
restoretime    text           Yes      NULL 
synk
  • 5
  • 1
  • 4

1 Answers1

0

I assume it's a bug in phpMyAdmin, as search for that error message and comments for this answer seem to confirm. And it's quite easy to check: run the queries you've asked for in MySQL console.

Community
  • 1
  • 1
raina77ow
  • 103,633
  • 15
  • 192
  • 229
  • Sure looks like it. Did a little more research and found that the version of PHPMyAdmin we're running is 3.5.0 and the latest stable release is up 3.5.2.2, so it seems to be exactly what you were assuming: a bug. Sent our server admin an email to upgrade it, so as soon as he does that, I'll post another comment with how things went. Thanks! – synk Aug 31 '12 at 13:47