Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Selection.php
- <?php
- $sql_Sat1 = "SELECT * FROM bandSched WHERE day='saturday' AND stage='stage 1'";
- mysql_query($sql_Sat1);
- $result_Sat1 = mysql_query($sql_Sat1);
- while($row = mysql_fetch_array($result_Sat1))
- {
- echo "<ul><li>";
- echo'<input type="checkbox" name="id[]" value="'.$row['id'].' " id="bandSched_' . $row['id'] . '" />';
- echo '<label for="bandSched_' . $row['id'] . '">' . $row['timeShow']." ".$row['bandName'] . '</label>';
- echo "</li></ul>";
- }
- ?>
- Process.php
- <?php
- if ( ! empty($_POST['id']))
- { foreach($_POST['id'] as $key => $id) { $_POST['id'][$key] = mysql_real_escape_string($_POST['id'][$key]); }
- $in = implode(', ', $_POST['id']);
- $sql_Sat1 = "SELECT * FROM bandSched WHERE id IN ($in) ORDER BY FIELD(id, $in)";
- $result = mysql_query($sql_Sat1) or die('MySQL Error ' . mysql_errno() . ': ' . mysql_error());
- }
- if ( ! isset($result))
- {
- echo 'You did not select anything';
- }
- else
- {
- while ($row=mysql_fetch_assoc($result))
- {
- echo "<tr>";
- echo "<td>". $row['timeShow'] ."</td><td>" . $row['bandName'] . "</td>";
- echo "</tr>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement