chriscloyd Posted December 14, 2006 Share Posted December 14, 2006 heres my problem i click the link and it doesnt change the orderheres my links[CODE]<html>Order By <a href="?menu=company&page=news&order=id">Id</a><a href="?menu=company&page=news&order=title"> Title</a><a href="?menu=company&page=news&order=first,last"> Author</a></html>[/CODE]heres my script[CODE]<?phpif ($_POST['order']){ $order = $_POST['order'];} else { $order = 'id';}$query = "SELECT * FROM news ORDER BY '$order' DESC LIMIT $limitvalue, $limit"; $result = mysql_query($query) or die("Error: " . mysql_error());?>[/CODE] Link to comment https://forums.phpfreaks.com/topic/30691-help-mysql-order-not-working/ Share on other sites More sharing options...
Eric_Ryk Posted December 14, 2006 Share Posted December 14, 2006 It's $_GET["order"] not $_POST["order"]You use $_GET with the URL. Link to comment https://forums.phpfreaks.com/topic/30691-help-mysql-order-not-working/#findComment-141411 Share on other sites More sharing options...
chriscloyd Posted December 14, 2006 Author Share Posted December 14, 2006 wow stupid mistake on my behalf Link to comment https://forums.phpfreaks.com/topic/30691-help-mysql-order-not-working/#findComment-141414 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.