Jump to content

[SOLVED] having to double click delete ?


sandbudd

Recommended Posts

<?


session_start();


if(!session_is_registered(myusername)){


header("location:main_login.htm");


}


?>
<table width="37%" border="0" align="center" cellpadding="0" cellspacing="0">


 <tr>


   <td width="103"> </td>


   <td colspan="2"> </td>
 </tr>


 <tr>


   <td> </td>


   <td colspan="2"> </td>
 </tr>


 <tr>


   <td><a href="logout.php">Log Out</a></td>


   <td width="164"><a href="changepass.php">Change Password</a></td>
   <td width="313"><a href="retrieve.php">RFQ Submitted Information</a></td>
 </tr>
</table>

<?php

$db_host = ''; 
$db_user = ''; 
$db_pwd = '';

$database = '';
$table = '';


if (!mysql_connect($db_host, $db_user, $db_pwd))
   die("Can't connect to database");

if (!mysql_select_db($database))
   die("Can't select database");

//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM ae_gallery") or die(mysql_error());

//Puts it into an array
while($info = mysql_fetch_array( $data ))

{

echo "<table align=\"center\" border=1 bordercolordark=\"#777777\"  width=\"60% 


\" bordercolorlight=\"#dddddd\" bgcolor=\"BBBBBB\">"; 
//Outputs the image and other data

Echo "<tr><td width=\"50%\"><font size=\"3\" color=red>Name:</font>    ".$info['customer'] . "</td> ";
Echo "<td><font size=\"3\" color=red>Company:</font>    ".$info['company'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Address:</font>   ".$info['address'] . " </td>";
Echo "<td><font size=\"3\" color=red>City:</font>   ".$info['city'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>State:</font>   ".$info['state'] . " </td>";
Echo "<td><font size=\"3\" color=red>Zip:</font>    ".$info['zip_code'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Email:</font>    ".$info['email'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Phone:</font>    ".$info['phone'] . " </td>";
Echo "<td><font size=\"3\" color=red>Fax:</font>    ".$info['fax'] . " </td></tr>";
echo "<tr><td colspan=\"2\"><font size=\"2\" color=blue>Process Requested</font></tr></td>";
Echo "<tr><td><font size=\"3\" color=red>Type II:</font>   ".$info['type2'] . " </td>";
Echo "<td><font size=\"3\" color=red>Type III:</font>     ".$info['type3'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Burnish:</font>    ".$info['burnish'] . " </td>";
Echo "<td><font size=\"3\" color=red>Chromate:</font>   ".$info['chromate'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Chromate Hex Free:</font>    ".$info['hex'] . " </td>";
Echo "<td><font size=\"3\" color=red>Impregnation:</font>    ".$info['impregnation'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Strip:</font>   ".$info['strip'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Part Number:</font>   ".$info['part'] . " </td>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Part Description:</font>    ".$info['description'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Alloy:</font>    ".$info['alloy'] . " </td>";
Echo "<td><font size=\"3\" color=red>Quantity:</font>    ".$info['quantity'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Specifications:</font>   ".$info['spec'] . " </td>";
Echo "<td><font size=\"3\" color=red>Color:</font>    ".$info['color'] . " </td></tr>";
echo "<tr><td colspan=\"2\"><font size=\"2\" color=blue>How Did You Hear About Us?</font></td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Repeat Customer:</font>   ".$info['repeat_customer'] . " </td>";
Echo "<td><font size=\"3\" color=red>Internet Search:</font>   ".$info['isearch'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Internet Directory:</font>   ".$info['internet_directory'] . " </td>";
Echo "<td><font size=\"3\" color=red>Referral:</font>    ".$info['referral'] . " </td></tr>";
Echo "<tr><td><font size=\"3\" color=red>Yellow Pages:</font>   ".$info['yellow_pages'] . " </td>";
Echo "<td><font size=\"3\" color=red>Trade Show:</font>   ".$info['trade'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Other:</font>   ".$info['other'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>Notes:</font>   ".$info['notes'] . " </td></tr>";
Echo "<tr><td colspan=\"2\"></td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red>File:</font><a href=upload/".$info['image1'] .">   ".$info['image1'] . " </a>";
Echo "<a href=upload/".$info['image2'] .">   ".$info['image2'] . " </a>";
Echo "<a href=upload/".$info['image3'] .">   ".$info['image3'] . " </a>";
Echo "<a href=upload/".$info['image4'] .">   ".$info['image4'] . " </a>";
Echo "<a href=upload/".$info['image5'] .">   ".$info['image5'] . " </a>";
Echo "<a href=upload/".$info['image6'] .">   ".$info['image6'] . " </a>";
Echo "<a href=upload/".$info['image7'] .">   ".$info['image7'] . " </a>";
Echo "<a href=upload/".$info['image8'] .">   ".$info['image8'] . " </a>";
Echo "<a href=upload/".$info['image9'] .">   ".$info['image9'] . " </a>";
Echo "<a href=upload/".$info['image10'] .">   ".$info['image10'] . " </a>";
Echo "<a href=upload/".$info['image11'] .">   ".$info['image11'] . " </a>";
Echo "<a href=upload/".$info['image12'] .">   ".$info['image12'] . " </a>";
Echo "<a href=upload/".$info['image13'] .">   ".$info['image13'] . " </a>";
Echo "<a href=upload/".$info['image14'] .">   ".$info['image14'] . " </a>";
Echo "<a href=upload/".$info['image15'] .">   ".$info['image15'] . " </a>";
Echo "<a href=upload/".$info['image16'] .">   ".$info['image16'] . " </a>";
Echo "<a href=upload/".$info['image17'] .">   ".$info['image17'] . " </a>";
Echo "<a href=upload/".$info['image18'] .">   ".$info['image18'] . " </a>";
Echo "<a href=upload/".$info['image19'] .">   ".$info['image19'] . " </a>";
Echo "<a href=upload/".$info['image20'] .">   ".$info['image20'] . " </a></td></tr>";
Echo "<tr><td colspan=\"2\"><font size=\"3\" color=red></font><a href='retrieve.php?id=".$info['id']."'>delete</a></td></tr><br><br>";

}
if(isset($_GET['id'])) {
$query = "DELETE FROM ae_gallery WHERE id=".$_GET['id']." LIMIT 1";
mysql_query($query) or die("Could not delete the entry!");
}



?>

Link to comment
https://forums.phpfreaks.com/topic/113786-solved-having-to-double-click-delete/
Share on other sites

My first guess is that you have your delete condition after your info dump so it's getting deleted on first click but your info dump isn't being updated until next page request.  Test it out by instead of clicking the delete a 2nd time, click your refresh button, or go look in your phpmyadmin or w/e after the first click.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.