ryanfilard Posted May 27, 2011 Share Posted May 27, 2011 How can I make this so it makes my table descending. http://www.ryanweekly.com/user/index.php?p=ryanweekly <?PHP $maxRows_posting = 6; $pageNum_posting = 0; if (isset($_GET['pageNum_posting'])) { $pageNum_posting = $_GET['pageNum_posting']; } $startRow_posting = $pageNum_posting * $maxRows_posting; mysql_select_db($database_posting, $posting); $query_posting = "SELECT post, fromwho FROM post WHERE username = '$uasilly'"; $query_limit_posting = sprintf("%s LIMIT %d, %d", $query_posting, $startRow_posting, $maxRows_posting); $posting = mysql_query($query_limit_posting, $posting) or die(mysql_error()); $row_posting = mysql_fetch_assoc($posting); if (isset($_GET['totalRows_posting'])) { $totalRows_posting = $_GET['totalRows_posting']; } else { $all_posting = mysql_query($query_posting); $totalRows_posting = mysql_num_rows($all_posting); } $totalPages_posting = ceil($totalRows_posting/$maxRows_posting)-1; $queryString_posting = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_posting") == false && stristr($param, "totalRows_posting") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_posting = "&" . htmlentities(implode("&", $newParams)); } } $queryString_posting = sprintf("&totalRows_posting=%d%s", $totalRows_posting, $queryString_posting); $queryString_recordset2 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_recordset2") == false && stristr($param, "totalRows_recordset2") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_recordset2 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_recordset2 = sprintf("&totalRows_recordset2=%d%s", $totalRows_recordset2, $queryString_recordset2); $userida = $_REQUEST['p']; require_once('../Connections/loginsys.php'); ?> Link to comment https://forums.phpfreaks.com/topic/237672-descending-table/ Share on other sites More sharing options...
mikesta707 Posted May 27, 2011 Share Posted May 27, 2011 use the order by clause. I don't know what column you want to sort by descending but that page should give you enough information to get started Link to comment https://forums.phpfreaks.com/topic/237672-descending-table/#findComment-1221361 Share on other sites More sharing options...
ryanfilard Posted May 27, 2011 Author Share Posted May 27, 2011 use the order by clause. I don't know what column you want to sort by descending but that page should give you enough information to get started All of them Link to comment https://forums.phpfreaks.com/topic/237672-descending-table/#findComment-1221367 Share on other sites More sharing options...
mikesta707 Posted May 27, 2011 Share Posted May 27, 2011 Sorry, that link was messed up. try this here Look at the examples they give on that page. It shows how to sort by multiple columns Link to comment https://forums.phpfreaks.com/topic/237672-descending-table/#findComment-1221372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.