473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

delete button

hi everybody,
there is someone who can help me to find out how to create a delete button .Indeed,I have then 2 buttons, one for insert(works well),second one is therefore for to delete.
You can check out below the code:[php]
?>
<?php

if(isset($_POST['Delete'])){
$query="DELETE FROM SCANNER WHERE SCANNER.scanNo ='".$scanNo."'";
$result=mysql_query($query);
}
?>
<form action="procescanin.php" method="get" name="scanin_form">
<div align="center">
<table>
<tr><td> scannerNummer:</td>
<td> <input name="scanNo" type="text" ></td><td>&nbsp;</td>
</tr>
<tr><td>Type:</td>
<td> <input name="type_id" type="text" ></td><td>&nbsp;</td>

</tr>
<tr><td>&nbsp;</td><td><input name="Insert" type="submit" value="Insert" ></td>
<td>&nbsp;</td><td><input name="Delete" type="submit" value="Delete"></td>
<td>&nbsp;</td><td><input type="hidden" name="For_to_delete" value="<?php echo $_REQUEST["scanNo"];?>"> </td>

</tr>
</table>
</div>
</form>[/php]
At the end when i click on delete,it acts as insert button.

Regards,
Bazubwabo J.B.
IT student
Jan 10 '07 #1
1 7772
b1randon
171 Expert 100+
hi everybody,
there is someone who can help me to find out how to create a delete button .Indeed,I have then 2 buttons, one for insert(works well),second one is therefore for to delete.
You can check out below the code:[php]
?>
<?php

if(isset($_POST['Delete'])){
$query="DELETE FROM SCANNER WHERE SCANNER.scanNo ='".$scanNo."'";
$result=mysql_query($query);
}
?>
<form action="procescanin.php" method="get" name="scanin_form">
<div align="center">
<table>
<tr><td> scannerNummer:</td>
<td> <input name="scanNo" type="text" ></td><td>&nbsp;</td>
</tr>
<tr><td>Type:</td>
<td> <input name="type_id" type="text" ></td><td>&nbsp;</td>

</tr>
<tr><td>&nbsp;</td><td><input name="Insert" type="submit" value="Insert" ></td>
<td>&nbsp;</td><td><input name="Delete" type="submit" value="Delete"></td>
<td>&nbsp;</td><td><input type="hidden" name="For_to_delete" value="<?php echo $_REQUEST["scanNo"];?>"> </td>

</tr>
</table>
</div>
</form>[/php]
At the end when i click on delete,it acts as insert button.

Regards,
Bazubwabo J.B.
IT student
Post the rest of your code. Also, you may want to include a hidden field called "function" and use javascript to write "insert" or "delete" in the value that way you can test just the one field. Getting the value of your submit buttons may be tricky.
Jan 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Elliot M. Rodriguez | last post by:
I have a Delete button in my datagrid. I'm attempting to add some code confirming whether the user wishes to really delete the item or not. The confirm pops up, but I cannot suppress the...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
5
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious...
1
by: JasonK | last post by:
I would like to move the Delete button such that it displays one time in the footer row, rather than on every row. I've seen lots of questions asked on the subject around the net, but no answer...
3
by: bluez | last post by:
I want to design a webpage where user can search the data from the database and list out the related records. Each of the record got a delete button which allow user to delete the record. ...
7
by: ITAutobot25 | last post by:
My delete button is not working in my GUI and my due date is today before midnight. Can anyone show me how to correct this error? My assignment statement is below as well as 5 classes. InventoryGUI...
0
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation....
0
by: pavankumar106 | last post by:
Hi im stuck in sm simple pb ..im having a datalist in wich im having images and each image have a delete button below it.now wen I press delete button I shud be able to delete that image in dataset...
1
by: faisalabad | last post by:
Hi everyone newb, i am connecting to database then accessing a table and printing whole table on php page as table with "delete" button at the end of every row (so same delete button being printed...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.