wmguk Posted June 23, 2008 Share Posted June 23, 2008 Hey, $orderby is set using a form. $orderby = (empty($_POST['orderby'])) ? "name ASC" : $_POST['orderby'] ; then the actual form <form action="../show_tile.php" method="POST" name="search"> <input type="image" name="orderby" value="name ASC" src="../images/asc.gif" /> <input type="hidden" name="colour" value="<? echo $colour ; ?>" /> </form> <form action="../show_tile.php" method="POST" name="search"> <input type="image" name="orderby" value="name DESC" src="../images/desc.gif" /> <input type="hidden" name="colour" value="<? echo $colour ; ?>" /> </form> I am using this query: $result = mysql_query("SELECT * FROM products WHERE colour = '$colour' ORDER BY $orderby"); I checked it using a GET and its not passing the variable orderby - <input type="image" name="orderby" value="name ASC" src="../images/asc.gif" /> any thoughts what Ive missed? Link to comment https://forums.phpfreaks.com/topic/111466-solved-order-by-fails/ Share on other sites More sharing options...
wmguk Posted June 23, 2008 Author Share Posted June 23, 2008 scrub that, i sorted it. just set a hidden type. Link to comment https://forums.phpfreaks.com/topic/111466-solved-order-by-fails/#findComment-572123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.