PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
So I got a rows in a database that I need to sort by 4 strings. atm I am using this bit of code. I think it should work maybe its an easy error or you need a special function for sorting rows based on a string.
$query = 'SELECT * FROM url_list WHERE url_kategori = '$kategori1' ORDER BY stringColumnName1 ASC, stringColumnName2 DESC, stringColumnName3 ASC, stringColumnName4 DESC';
Mark Baker wrote:$query = 'SELECT * FROM url_list WHERE url_kategori = '$kategori1' ORDER BY stringColumnName1 ASC, stringColumnName2 DESC, stringColumnName3 ASC, stringColumnName4 DESC';
Thanks for the answer, it isnt exactly what I need. I am gonna make 4 different select statements. it is the column url_kategori I need to sort based on 4 strings that exists among the rows. Any idea if I explained it this way?