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!
in the last code-line you have used a simple quote , php will not read the content of your variable $mystate .you can correct this by using this instead :
'order by state = '.$mystate.' DESC'; or you can use a double quote : "order by state = $mystate DESC"; .or "order by state =,$mystate,DESC"
When placing a variable within a string you have to make sure to your variable accessible to php.