ok so what i want to do is make a updates page that will show the last added user based on the ID column but the trick is that the column dropped must equil 0 so i am not sure what to do.
here is my code:
<?php
include('db/db_bhi.php');//file with the information to connect to the database
$data = mysql_query("SELECT * FROM email_contact_list WHERE ID=(select MAX(ID) from email_contact_list)");
// This creates a loop which will repeat itself until there are no more rows to select from the database. We getting the field names and storing them in the $row variable. This makes it easier to echo each field.
while ($row = mysql_fetch_array($data)) {
if (isset($row['dropped']) && $row['dropped'] != '' && $row['dropped'] != NULL && $row['dropped'] == 0){
if (isset($row['firstname']) && $row['firstname'] != '' && $row['firstname'] != NULL){
$firstname = "$row[firstname] ";
}
else { $firstname='';}
if (isset($row['wifename']) && $row['wifename'] != '' && $row['wifename'] != NULL){
$wifename = "$row[wifename] ";
}
else { $wifename='';}
if (isset($row['lastname']) && $row['lastname'] != '' && $row['lastname'] != NULL){
$lastname = "$row[lastname]";
}
else { $lastname='';}
$date_entered = "$row[date_entered]";
$ID = "$row[ID]";
if ($row['dropped']==0){
echo "<h2>The latest addresses in the database is:</h2>\"$firstname$wifename$lastname\"<br>$firstname$wifename$lastname was entered on $date_entered";
}
else if ($row['dropped']==1){
echo "<h2>The latest addresses in the database is:</h2>\"$firstname$wifename$lastname\"<br>$firstname$wifename$lastname was entered on $date_entered<br><br><b><u>But has since been deleted</u></b>";
}
}
else { echo "something went wrong"; }
}
?>