|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Order by ? in mdb2
Hi!
When I write a query like this the ORDER BY statement is not executed. The last ? is to decide whether the ORDER BY is ASC or DESC. SELECT * FROM table WHERE image_id = ? ORDER BY ? ? So, is it possible to use ORDER BY ? in mdb2? Thanks, klgn |
|
#2
|
|||
|
|||
|
This can't work because 'ASC' or 'DESC' would be quoted, i.e. the query string will be invalid. The error message that you get should tell you that, doesn't it?
I'd recommend to add the sorting direction via string concatenation. |
|
#3
|
|||
|
|||
|
Quote:
No, I don't get an error, the ORDER BY clause just isn't executed. And as far as i know the ASC/DESC doesn't have to be in quotes - i've never used that, and it has always worked when I hardcoded it. |
|
#4
|
|||
|
|||
|
Quote:
Hi all, I am a new member of forum. Would a newcomer be warmly welcome here? Good day you guys!!! |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Order by ? in mdb2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|