Solved

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

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

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…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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