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 
11
  • What mysql function are you using to query your sql? Commented Aug 30, 2012 at 20:21
  • what's the type of your level column ? Commented Aug 30, 2012 at 20:23
  • 1
    doesnt showing rows 0-1 mean in phpmyadmin showing 2 results? Commented Aug 30, 2012 at 20:25
  • mysql_fetch_array...haven't tried mysql_fetch_assoc Commented Aug 30, 2012 at 20:30
  • @jidma - INT with no auto increment Commented Aug 30, 2012 at 20:32

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.