Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / October 2007



Tip: Looking for answers? Try searching our database.

updating information to database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
navin - 06 Oct 2007 19:45 GMT
Hi All,

i have page which shows supplier information in a table format.

Supplier Name       Contact        Email
AAA                       xxxxx          xxxxxxx

In order to change or update information for the supplier, i want to
display supplier name in the table cell as a link.

so if user clicks on the link with the supplier name, it should take
the user to another page (suplier update page) where it should
display
the supplier information in text boxes. if users wants they can then
change information and update it into database.

Could anyone please tell me how to do the abve.

If anybody has any other idea to update the information in database,
please share.

Appreciate any ideas on this.

thanks,

Navin
Bob Barrows [MVP] - 06 Oct 2007 20:17 GMT
> Hi All,
>
[quoted text clipped - 18 lines]
>
> Appreciate any ideas on this.

I would suggest you give Eli Robillard's GenericDb a try. Although the
version I used a few years ago didn't exactly follow best practices, perhaps
he's updated it since then, and, even if he hasn't, studying the code should
give you an idea about how this is done.
http://www.genericdb.com/

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Adrienne Boswell - 09 Oct 2007 16:00 GMT
> Hi All,
>
[quoted text clipped - 5 lines]
> In order to change or update information for the supplier, i want to
> display supplier name in the table cell as a link.

<td><a href="update.asp?supplier=<%=id%>" title="Update this record">AAA
</a></td>

> so if user clicks on the link with the supplier name, it should take
> the user to another page (suplier update page) where it should
> display
> the supplier information in text boxes. if users wants they can then
> change information and update it into database.

sql = "SELECT fields FROM table WHERE id = " & request.querystring("id")
'open up recordset, assign values, eg: name = rs("name")

if request.servervariables("REQUEST_METHOD") = "POST" then
       if request.form("name") <> "" then
              update = "UPDATE table SET field = '" & request.form("name")
& "' WHERE id = " & request.form("id")
              'execute statement
              'maybe take the user back to the original page
       else
              'give the user some sort of message
       end if
end if
%>
<form method="post" action="<%=request.servervariables
("SCRIPT_NAME")%>">
<fieldset><legend>Update Information</legend>
<label for="name">Name: </label> <input type="text" name="name"
id="name" value="<%=name%>">
<p><input type="hidden" name="id" value="<%=request.querystring
("id")%>">
<input type="submit" value="Update Record"></p>
</fieldset>
</form>

> Could anyone please tell me how to do the abve.

See above... you can do a lot more, create functions, etc.

> If anybody has any other idea to update the information in database,
> please share.
>
> Appreciate any ideas on this.

HTH

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.