Solved

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

Posted on 2006-06-26
4
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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