Hello, sorry if the question was unclear but I am asking a serious question, not just screwing around. What I want to do is this...
Like you would run a query on your database and do $myrow[0] to display the first column of results in your database, I want to do something like that in my sql statement.
So I'd want something like...
"SELECT * FROM $Table ORDER BY ?? ASC"
?? Would be the first column, the one that holds the table ID. However, this page is dynamic so I won't know what the ID name is going to be. Otherwise I would just type in in. For one table it could be items_id and for another it could be users_id. Therefore, I was wondering if there was something I could type that would order it by the first column, rather than me having to specify a name. Or is there a way I could dynamically retrieve the column name?
I know that if I named my table and id similarly I could probably do something like...
"SELECT * FROM $Table ORDER BY " . $Table . "_id ASC"
But that would require everything in the database to be named properly and could encounter errors if it wasn't. I'll do this if there's no other solution, but it seems like there would be a better way. I just don't know what it is.
I'm not sure if this is going to be any more clear, sorry.
Wil