I have the following code below. I have added buttons to each entry that pops up but I need the buttons to do certain things and I’m stuck.
When the Approve button is pressed I want the entire entry to go to another table called “incomplete” (no quotations) and then I want the record to be deleted from the table “needs” (no quotations), which it currently resides in.
When the Deny button is pushed I want the entry to just be deleted from the table “needs” (no quotations).
Tried to figure it out on my own but I have nothing. I’m new to all this and the fact that I’ve gotten this far makes me excited
[php]$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) {
die('Could not connect: ’ . mysql_error());
}
$db_selected = mysql_select_db(DB_NAME, $link);
if (!$db_selected) {
die ('Cant use ’ . DB_NAME . ': ’ . mysql_error());
}
$query = mysql_query(“SELECT * FROM needs”);
while ($rows = mysql_fetch_array($query)):
$firstname = $rows[‘firstname’];
$lastname = $rows[‘lastname’];
$address = $rows[‘address’];
$city = $rows[‘city’];
$state = $rows[‘state’];
$phone = $rows[‘phone’];
$email = $rows[‘email’];
$typeofneed = $rows[‘typeofneed’];
echo “$firstname $lastname
$address
$city $state
$phone
$email
$typeofneed
”;
echo “Approvedeny
---------------------------
”;
endwhile;[/php]