473,769 Members | 7,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

delete button

14 New Member
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_q uery($query);
}
?>
<form action="procesc anin.php" method="get" name="scanin_fo rm">
<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_de lete" 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 7835
b1randon
171 Recognized Expert New Member
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_q uery($query);
}
?>
<form action="procesc anin.php" method="get" name="scanin_fo rm">
<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_de lete" 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
2258
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 submission when selecting Cancel. Heres what I have so far: ' adding the javascript call to the button: Private Sub dgItem_ItemCreated(ByVal sender As Object, ByVal e As
3
2794
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, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts: I am working in the Microsoft Development Environment 2003 (Version
3
13753
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. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
5
6703
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 missing here, but after 2 days I am ready to explode ! Please help. To create the Delete button I selected the grid in design view, clicked the "Columns" property and added the Delete button in the
1
6390
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 that seems to solve the problem. I have tried a few things: - adding a button, setting it's command name to Delete. Problem with this is that the CommandArgument value does not get set to the SelectedIndex of the GridView. Instead it has the...
3
3426
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. Filename : search_student.php <?php include("../user_access/user_access_control.php"); include("../Database/database.php"); $searchStudentControl = new Access_user;
7
6943
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 is the main class to begin execution. Thanks! • Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the...
0
2822
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. What happened is if I select cancel on my confirmation button, it executes the griedview postback which i assigned in my code behind. Please see my codes below... Code beind: protected void gvDefectCatalog_RowDataBound(object sender,...
0
1283
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 and bind it to datalist.i ve tried to run the code in button click event of delete,button command click event and also datalist delete command event.But its not gng to break point at all.. Can u say da reason y its not firing..:) n can anyone tell me...
1
2150
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 many times). want i want to do is if a user to be able to click on any delete button and that row data get deleted from database and reload the page with updated table. i can print the table with data and "delete " button at the end but only...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.