Solved

Syntax error near “ORDER BY order DESC” in MySQL?

Posted on 2013-05-11
6
839 Views
Last Modified: 2013-05-17
Hi Guys !


I have made a database importation, all was okay !

Then i started a server who added some items in my DB, but now when i want to see which items i have in my database and i click on any table of my DB, i have this error :

SELECT tracking_active FROM . WHERE db_name = 'dol'  AND table_name = 'ability'  ORDER BY version DESC


Please someone has an idea ?

I changed the root password.
0
Comment
Question by:Amoniks
6 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 39157936
Is this SQL Server or MySQL? You've posted in both areas.
0
 
LVL 45

Expert Comment

by:Kdo
ID: 39157950
And, there's no error posted.   :(
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39158012
You might try this:
SELECT tracking_active FROM dol.ability ORDER BY version DESC

In MySQL the FROM clause can use the format DBNAME.TABLENAME
http://dev.mysql.com/doc/refman/5.0/en/select.html

You can also explicitly SELECT the data base by name.  If you have the "dol" data base selected, your query might work this way.
SELECT tracking_active FROM ability ORDER BY version DESC
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39159785
And, there's no error posted.   :(
I could be wrong, but I believe it is in the title.  :)

But yes, since this has nothing to do with MS SQL Server, that topic should be dropped.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39159878
Please test the query I posted and let us know if it worked.  There are a lot of moving parts to PHP + MySQL.  If you want to show us the PHP code that sets up  your test case (the SSCCE) it might be easier to give assistance.

If you want a good learning resource to help you get started with PHP and MySQL, I can recommend this book.  Now in its fifth printing it has been a permanent part of my professional library since Edition One.  Good examples, very readable and it comes with a downloadable code library you can copy and modify for your own needs.
http://www.amazon.com/dp/0672328887
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39174052
Please see the grading guidelines:
http://www.experts-exchange.com/help/viewHelpPage.jsp?helpPageID=26

Please explain why you did not respond to my last request and why you gave a marked-down grade?  I don't understand what was wrong with my efforts to help you.

Thanks, ~Ray
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SLQ View not updating 10 47
Would coalesce be what I use here and, if so, how? 8 42
Change part of a string 2 24
SQL Query 3 0
Read about achieving the basic levels of HRIS security in the workplace.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now