xeidor Posted March 6, 2007 Share Posted March 6, 2007 I have a page with a bunch of info on it, what I want to do is have the user click check boxes next to the ones they want to see then submit it and only those selected items show up on the following page (results.php) . So I set up the check boxes and had the info submit via get. The problem is that the other page only shows 1 of the items the checked not all of them. Heres the url that is sent after selecting the items they want to see result.php?Submit=Submit&recordID=62&recordID=66&recordID=65 The results page only shows the last record (recordID=65), and ignores the previous 2. The code I have on the results page is <?php $colname_Recordset1 = "1"; if (isset($_GET['recordID'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']); } mysql_select_db($database_Crewlist, $Crewlist); $query_Recordset1 = sprintf("SELECT * FROM flights WHERE id = '%s' ORDER BY Datea, ETA ASC", $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1, $Crewlist) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> Any ideas on how to get all three of the selected items to show up on the results page? Any help would be appreicated thanks. Quote Link to comment https://forums.phpfreaks.com/topic/41371-solved-displaying-multiple-records/ Share on other sites More sharing options...
jcbarr Posted March 6, 2007 Share Posted March 6, 2007 You would need to catch them in an array, and then use a foreach loop to process each one of them and output your desired information. Right nowthe recordID is simply overwritten until it gets to the last one, and that is the only recordID that your script is actually processing. Quote Link to comment https://forums.phpfreaks.com/topic/41371-solved-displaying-multiple-records/#findComment-200441 Share on other sites More sharing options...
xeidor Posted March 6, 2007 Author Share Posted March 6, 2007 Ill look into that, Thanks for the reply Quote Link to comment https://forums.phpfreaks.com/topic/41371-solved-displaying-multiple-records/#findComment-200447 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.