Solved

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

Posted on 2006-06-26
4
166 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now