kts Posted March 27, 2009 Share Posted March 27, 2009 Hey, I am currently trying to sort out results that I am receiving back from MySQL. There are 3 different things I want to sort by Person, Completed, On/or I am doing a huge If statement and know this is wrong, but for some reason can't think of a better way to solve this... Any comments please... Thank you Link to comment https://forums.phpfreaks.com/topic/151433-sorting-mysql-results-with-a-form/ Share on other sites More sharing options...
ricmetal Posted March 27, 2009 Share Posted March 27, 2009 i dont know how long the code will be but im guessing you're retreiving all the data first and then sorting it out with php you should retreive the data based on the "sort by", then display it like on click query by person Link to comment https://forums.phpfreaks.com/topic/151433-sorting-mysql-results-with-a-form/#findComment-795445 Share on other sites More sharing options...
kts Posted March 27, 2009 Author Share Posted March 27, 2009 Sorry I didn't clarify well enough im doing like if($person != ""){ $addtosql = ""; } else { if($open != ""){ $addtosql = ""; } etc etc Link to comment https://forums.phpfreaks.com/topic/151433-sorting-mysql-results-with-a-form/#findComment-795450 Share on other sites More sharing options...
Maq Posted March 27, 2009 Share Posted March 27, 2009 Can you show us your current code? The code you provided does not do anything. I'm pretty sure I understand what you mean. The ways to sort from the user could differ depending on what they choose from the form page. Link to comment https://forums.phpfreaks.com/topic/151433-sorting-mysql-results-with-a-form/#findComment-795507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.