无法在url中显示id,并且插入数据库的数据显示为空白

I want to get get id at the url. It displays the name of id variable instead of displaying the id. I also want eventid, event, venue and username to be inserted into the database, but event and username shows blank but the id increases. Whats the problem ?

<?php
require 'database.php';

$qry = "SELECT b.event_id, b.event, b.venue, u.username, s.name, s.gender, s.email, s.phone FROM bulletin b JOIN unite u JOIN student s WHERE b.event_id = u.event_id AND u.username = s.username ORDER BY event_id";
$result = mysql_query($qry) OR die (mysql_error());
     while ($row = mysql_fetch_row($result)){

             $eventid = $row[0];
                 $event = $row[1];
                 $venue = $row[2];
                 $username = $row[3];
                 $name = $row[4];
                 $gender = $row[5];
                 $email = $row[6];
                 $phone = $row[7]; 

?>

    <tr>
    <td><center><?php echo $row[0]; ?></center></td>
    <td><center><?php echo $row[1]; ?></center></td>
    <td><center><?php echo $row[2]; ?></center></td>
    <td><center><?php echo $row[3]; ?></center></td>
    <td><center><?php echo $row[4]; ?></center></td>
    <td><center><?php echo $row[5]; ?></center></td>
    <td><center><?php echo $row[6]; ?></center></td>
    <td><center><?php echo $row[7]; ?></center></td>
    <td><center>
              <br><form method="post" action="attend.php?eventid=<?php echo $row['event_id']; ?>" name="event_form1" target="_top">
              <input type="submit" name="submit" value=" Attend "></form></br>
              <br><form method="post" action="not_attend.php" name="event_form1" target="_top">
              <input type="submit" name="submit" value=" Not Attend "></form></center></br>                       
             </td>

            </tr>
             <?php 
             } ?>

attend.php

<?php
session_start();
require 'database.php';
$events= $_GET['eventid'];

$qry = "INSERT INTO attend (event_id, name_event, username) VALUES ('$events', '$event', '$username')";

$result = mysql_query($qry) or die (mysql_error());
if ($result){
//echo $result;
    header("location:activity_a.php?success=&eventid=$events");
    exit();
}else {
    die ("Query failed");
}

?>

you're not passing any of the variables through the form, right now, you're just setting the submit button. if you plan on using an attend/not attend system then you'll need to re-do the sql to pull the information again for the variables. OR, you'll need to set hidden inputs for each form

change your attend.php to this:

<?php
session_start();
require 'database.php';
$events= $_GET['eventid'];

$qry = "SELECT b.event, u.username FROM bulletin b JOIN unite u JOIN student s WHERE b.event_id = u.event_id AND u.username = s.username ORDER BY event_id";
$result = mysql_query($qry) OR die (mysql_error());
$row = mysql_fetch_array($result)
$event = $row[0];
$username = $row[1];

$nqry = "INSERT INTO attend (event_id, name_event, username) VALUES ('$events', '$event', '$username')";

$nresult = mysql_query($nqry) or die (mysql_error());
if ($nresult){
//echo $nresult;
    header("location:activity_a.php?success=&eventid=$events");
    exit();
} else {
    die ("Query failed");
}

?>

change this accordingly to match with your db.

EDIT:

I accidentally set the same variable and it got overwritten.