Solved

How do you insert a record from a link instead of a form?

Posted on 2006-06-26
4
170 Views
Last Modified: 2010-04-25
I am using Dreamweaver 8, PHP and mysql.

I am having trouble figuring out how to insert a record using a link and not a form.

After a search is completed, I want the user to be able to click a link and add the  id(primary key) of the results to a different database.

Is there a built in function to do this? If not, how would I code this functionality?

Thanks alot.




0
Comment
Question by:hep516
  • 2
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 16987503
Hi hep516,

What you need to do is add the primary key for the search results to the url of the link.  So you will have something in the repeat region that looks like this:

<a href="addme.php?id=<?php echo $your_recordset['id']; ?>">Add me!</a>

Next, you create the addme.php page and all it does is accept the $_GET['id'] (the query string) and use an Insert behavior to add it wherever.  Then return the user to the search page.  This is the easiest way.
0
 

Author Comment

by:hep516
ID: 16987574
Thanks!
0
 

Author Comment

by:hep516
ID: 16987608
Jason- You are a great help, I really appreciate it!
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16987712
Aw, shucks.  I blush.

No thanks are necessary...I volunteer because I enjoy it and it helps keep me sharp.

Good luck with the project.  Let me know if/when it goes live, I'd love to see how it ends up.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question