473,396 Members | 1,966 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,396 software developers and data experts.

How to update database rows with a form?

7
hello there, can anyone explain to me how can i update a data from a form so that the data in the database will change also.
what are the required coding that i should use?
i have a table in a database that user will insert data, after that, i will search the data according to NoId, after found it retrieve all the data and show in a form, how can i edit the data from the form and the data in database will change same according to the edit?
Mar 15 '11 #1

✓ answered by HaLo2FrEeEk

Your question is very difficult to understand, but I think what you're asking is how to pull data from a database into a form, edit the data in the form, then resubmit it to the database to update the existing data (as in, not write a new row). This is actually pretty simple, as long as there is a unique element in each row, usually an id.

Basically, pull out the information you want and construct your form, putting the relevant information into the placs you want it (so for example, echo a textarea and print the text from the database into it, or a textbox and do the same thing, etc.). Make a hidden form input (type="hidden") and set it's value to the id fom the row. Now you'll need a page that you submit to, it reads the $_POST array and gets the correct information, constructs an UPDATE query, and you UPDATE the row WHERE id = the id from your form's hidden input.

2 2033
HaLo2FrEeEk
404 256MB
Your question is very difficult to understand, but I think what you're asking is how to pull data from a database into a form, edit the data in the form, then resubmit it to the database to update the existing data (as in, not write a new row). This is actually pretty simple, as long as there is a unique element in each row, usually an id.

Basically, pull out the information you want and construct your form, putting the relevant information into the placs you want it (so for example, echo a textarea and print the text from the database into it, or a textbox and do the same thing, etc.). Make a hidden form input (type="hidden") and set it's value to the id fom the row. Now you'll need a page that you submit to, it reads the $_POST array and gets the correct information, constructs an UPDATE query, and you UPDATE the row WHERE id = the id from your form's hidden input.
Mar 15 '11 #2
howie
7
hey! tq for that. and sorry for my explanation, im not that good in english though.
Mar 17 '11 #3

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

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
27
by: VK | last post by:
<http://www.jibbering.com/faq/#FAQ3_2> The parts where update, replacement or add-on is needed are in <update> tag. 3.2 What online resources are available? Javascript FAQ sites, please...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
5
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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,...

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.