hi, all,i having code as below and the output is in the picture below as well

<?php require_once("includes/session.php"); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php confirm_logged_in(); ?>
<?php find_selected_item(); ?>
<?php include("includes/header.php"); ?>
<table id="structure">
    <tr>
        <div class="menu">
            <ul>
                <?php echo navigation($sel_cat, $sel_item); ?>
            </ul>
        </div>
        <td id="item">
            <?php
                $row_number = mysql_query("SELECT * FROM items");
                $num_rows = mysql_num_rows($row_number);
                $check =$_SESSION['username'];
                $query = "SELECT id, winner, item_status ";
                $query .= "FROM items ";
                $query .= "WHERE winner = '{$check}' ";
                $query .= "LIMIT 1";
                $result_set = mysql_query($query);
                confirm_query($result_set);

                if (mysql_num_rows($result_set) == 1){
                    $result = mysql_query("SELECT * FROM items WHERE winner='$check'");

                    //-count results
                    $numrows=mysql_num_rows($result);
                    echo "you currently have "  .$numrows . " items purchased. \n";

                    //-create while loop and loop through result set
                    while($row=mysql_fetch_array($result)){
                        $item=$row['item_name'];
                        $item_status=$row['item_status'];
                        $seller =$row['seller_name'];
                        $ID=$row['id'];
                        $current_bidding_price=$row['current_bidding_price'];
                        $_SESSION['item_id'] = $ID;
                        $_SESSION['item_name'] = $item;
                        $_SESSION['current_bidding_price'] = $current_bidding_price;
                        $_SESSION['seller'] = $seller;
                        $check1 = 0 ;

                        //-display the result of the array
                        echo "<ul>\n"; 
                        echo "" . "<a href=\"index.php?item=$ID\">"  .$item . "</a>\n";
                        if($item_status ==0){
                            echo "" . "<a href=\"sellerdetail.php\">"  ."<input type=\"submit\" value=\"Pay Now\" >". "</a>\n";
                        } else {
                            echo "" . "<a href=\"index.php?item=$ID\">"  ."<input type=\"submit\" value=\"CHECK\" >". "</a>\n";
                        }
                        echo "</ul>";
                        $NULL = null;

                    }
                } else {
                    echo "you not won/purchased anything currently";
                }
            ?>
        </td>
    </tr>
</table>
<?php require("includes/footer.php"); ?>

http://i325.photobucket.com/albums/k392/sarjan123/daniweb.jpg

for now i have 2 result, but if i choose the item "diamond" ,the session passed the "iphone4 by kokfui" to new php, i think this is because the looping have cleared the "diamond" information, anyone can help me solve this??thank you very much

certainly session don’t pass wrong id (it has nothing against you and will pass what ever you give). I would recommend reading any PHP tutorial don’t try to go to a stage when you don’t know the basics of a previous one.

Member Avatar

diafol

Try using code tags [ CODE ]

You'll get more replies.

You havnt using the session_start(); at the top pf your script.How can you passing your session variable?