kenrbnsn Posted July 11, 2006 Share Posted July 11, 2006 Can you post the code you're currently using? I think you're trying too hard and you're getting lost in the forest...Ken Quote Link to comment https://forums.phpfreaks.com/topic/14213-displaying-results-in-a-specific-order/page/2/#findComment-55996 Share on other sites More sharing options...
digitalgod Posted July 11, 2006 Author Share Posted July 11, 2006 hey ken,here's the code I'm currently using, it kind of works when you first decide on the order but if you go back and change the order it won't work anymore.Here's what I got[code]<?php//echo '<pre>' . print_r($_POST,true) . '</pre>'; $NAList = implode ("','", $_POST['NA']);$DAList = implode ("','", $_POST['DA']);$type = $_POST['type'];$dj = $_POST['dj'];foreach($_POST['order'] as $k => $val) {echo $_POST['NA'][$val] . '<br>';echo $k;mysql_query("UPDATE " . $prefix . "news SET orderList='".$k."' WHERE headline='".$_POST['NA'][$val]."'") or die(query_error()); }$_SESSION['add_result']=mysql_query("SELECT * FROM ".$prefix."news WHERE headline IN('$NAList') ORDER by orderList") or die(query_error());?>[/code]and in the newsletter_preview.php I got[code]<?php$result = $_SESSION['add_result']; while ($row=mysql_fetch_array($result)) {//display the articles in html}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14213-displaying-results-in-a-specific-order/page/2/#findComment-56390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.