Forum Moderators: open
I have a very simple MySql query. I just want to have the results ORDERED with specific filed value at first result, this value will be passed by URL.
SELECT *
FROM photos
ORDER BY?
I tried the following way and it worked only when I enter direct value, not when I pass the url variable:
SELECT *
FROM photos
ORDER BY FIND_IN_SET(2,photoID ) DESC
--> here I get at first place where photoID is 2
This do not work:
SELECT *
FROM photos
ORDER BY FIND_IN_SET(colname,photoID ) DESC
(colname is $_GET['x'])
Is FIND_IN_SET the right function to do this, or there is another one?
Guys help me out, I've been trying this all saturday... no way to have it working.
Thanks in advance
:-)
I explain it again to make sure you guys understand:
I have a simple Recordset in Dreamweaver, the query is:
SELECT *
FROM photos
The point is that I want some specific ORDER here. I want the first record on the result to be and specific value, eg. where photoID is = 5. I pass this number by URL parameter.
I want this result:
photoID, name
--------------
5 Hawaii
2 Habana
4 Miami
6 Japan
Waiting here for some help...
Thanks again!