View Single Post
Old 02-19-2007, 08:56 AM   #12 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
If you wanted to get the prices and use them in your select later on, it would be something like this:
PHP Code:
<?php
session_start
();
/* eliminate every ID we've chosen */
foreach ($_POST['boxes'] as $id){
  
/* temporary storage of the array of rows */
  
$result $_SESSION['result'];
  
/* clean any previus result stored */
  
$_SESSION['result'] = array();
  
/* keep only IDs and prices for the IDs not matching the chosen */
  
foreach ($result as $row)
    if (
$row['id'] != $id)
      
$_SESSION['result'][] = array('id'=>$row['id'], 'price'=>$row['price']);
  }
$result=$_SESSION['result'];
?>
And now you all the prices stored in $result, but why only select the price, since you have every available info located, you could gather anything which is nessesary..
Oh, another thing, the results are not sorted in any way.. But it should be fairly easy to create a simple sorting of the result array...
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote