| | |
Delete Operation
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 142
Reputation:
Solved Threads: 0
Hi all, i have written delete operation.......but its not deleting...........here is the code.......can u explain me whats wrong
php Syntax (Toggle Plain Text)
<? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; session_register("mailid1"); $query1="SELECT * FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); while($row = mysql_fetch_array($result)) { echo $row['subject']; } mysql_close(); ?> </b></td> <td align="right" colspan="3" style="padding-left:5px;" class="headtitle"> <a href="Contractor_reply.php"><b>Reply</b></a><span >/</span> <a href="contractor_mail_delete_action.php"><b>Delete</b></a><span>/</span> <a href="lll.html"><b>Next</b></a></td></tr> <tr><td><b><font size="2"><span style="color:005D95">From:</span></b> <? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; $query1="SELECT * FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); while($row = mysql_fetch_array($result)) { echo $row['From_user']; } mysql_close(); ?> </b></td></tr> </table> </td></tr> <tr><td> <? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; $query1="SELECT * FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); //echo mysql_num_rows($result) ; while($row = mysql_fetch_array($result)) { echo $row['contents']; } mysql_close(); ?> <? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; $query1="DELETE FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); //echo mysql_num_rows($result) ; mysql_close(); ?>
Last edited by Tekmaven; Jul 24th, 2008 at 3:23 am. Reason: Code tags
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Solved Threads: 5
PHP Syntax (Toggle Plain Text)
$query1="DELETE FROM autoalto_mail where mail_id=$mailid1";
you didn't mention any id to delete :
and print this: echo $_GET['mail_id']; in your contractor_mail_delete_action.php page .
PHP Syntax (Toggle Plain Text)
<a href="contractor_mail_delete_action.php"><b>Delete</b></a>
and print this: echo $_GET['mail_id']; in your contractor_mail_delete_action.php page .
Last edited by Shanti Chepuru; Jul 24th, 2008 at 3:05 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
first try in mysql with delete opration like:
use the mail_id which is in your table....
if its work ,then notify me...
PHP Syntax (Toggle Plain Text)
DELETE FROM autoalto_mail where mail_id=25
use the mail_id which is in your table....
if its work ,then notify me...
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
•
•
Join Date: Jun 2008
Posts: 142
Reputation:
Solved Threads: 0
This Contractor_mail_action_contents.php
This is Contractor_mail_delete_action.php
Its not deleting.........
php Syntax (Toggle Plain Text)
<?php session_start(); include('database.php'); $result = mysql_query("SELECT * FROM autoalto_mail" ); while($row = mysql_fetch_array($result)) { ?> <tr> <td width="5%"></td> <td><? echo $row['From_user'];?> <td><a href="contractor_mail_action_contents.php?mail_id=<? echo $row['mail_id'];?>"> <?echo $row['subject']; $subj=$row['subject']; session_register("subj");?> </a></td> <td><?echo $row['date']?></td> </tr> <tr> <td width="5%"></td> <td colspan="4" style="background-repeat: repeat-x;" background="images/dot.jpg" height="0" width="300"></td> </tr> <? } mysql_close(); ?> <? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; echo $_GET['mail_id']; $query1="SELECT * FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); //echo mysql_num_rows($result) ; while($row = mysql_fetch_array($result)) { echo $row['contents']; } mysql_close(); ?>
php Syntax (Toggle Plain Text)
<?php session_start(); include('database.php'); $result = mysql_query("SELECT * FROM autoalto_mail" ); while($row = mysql_fetch_array($result)) { ?> <tr> <td width="5%"></td> <td><? echo $row['From_user'];?> <td><a href="contractor_mail_action_contents.php?mail_id=<? echo $row['mail_id'];?>"> <?echo $row['subject']; $subj=$row['subject']; session_register("subj");?> </a></td> <td><?echo $row['date']?></td> </tr> <tr> <td width="5%"></td> <td colspan="4" style="background-repeat: repeat-x;" background="images/dot.jpg" height="0" width="300"></td> </tr> <? } mysql_close(); ?> <? session_start(); include('database.php'); $mailid1 = $_GET['mail_id']; $query1="DELETE FROM autoalto_mail where mail_id='".$mailid1."'"; $result = mysql_query( $query1 ); //echo mysql_num_rows($result) ; mysql_close(); ?>
Its not deleting.........
![]() |
Similar Threads
- what function can delete a space in a string? (C)
- Delete Files when the Recycle Bin is Hidden (Windows tips 'n' tweaks)
- Trapping a Delete event in BindingNavigator (C#)
- Visual C++ error LNK2022: metadata operation failed (80131187) (C++)
- deleting operation (C)
- stl vector - can you delete by position? (C++)
- XP Recovery Disk - Can't Find File - Why? (Windows NT / 2000 / XP)
- "operation system not regonized"won't boot (Troubleshooting Dead Machines)
- Another operation timed out thread! (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: code for rating
- Next Thread: E-Mail validation
| Thread Tools | Search this Thread |
apache api array basic beginner binary broken cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation neutrality oop parsing paypal pdf php problem query question radio random recursion remote root script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web xml youtube






