Hi,
Just testing this out now, no values are being passed to GET/POST functions, have been toying around with it but getting nowhere, any ideas?
Thanks
<?php
include "dbConfig.php";
if (isset ($_POST['submit']))
{
echo 'first loop reached';
$test = $_POST['first_name'];
echo 'Post test: '.$test;
$firstname = $_GET['first_name'];
echo 'Get test: '.$firstname;
$sql = "DELETE * FROM users WHERE id='".$_GET['id']."'";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_affected_rows()> 0)
{
echo 'User Deleted';
}
else
{
echo 'Not Deleted';
}
}
$getUser_sql = 'SELECT * FROM users';
$getUser = mysql_query($getUser_sql);
?>
<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<select name='name' style=" color:blue;text-align:left" size='21'>
<option value="" style="text-align:center">-Select User from List-</option>
<?php
while ($row = mysql_fetch_array($getUser))
{
?>
<option value =" <?php echo $row['id']; ?>"> <?php echo $row['first_name']; ?> <?php echo $row['last_name']; ?></option>
<?php } mysql_free_result($getUser)?>
<? echo '  '; ?><input name="submit" value="Delete User" type="submit" />
</form>
</html>