i am trying to find an ajax answer to a mysql insert. basically, I want to have the link href set up like add.php?id=$someid and once clicked the ajax will insert it into a db table without leaving the page and then return a new value. So if I had a link with the link text of "add link" and I clicked on it, the user's ID would be added to that link and the "add link" text would change to "link added" (kind of like when you digg something). does anyone have a version of this? Can do the php side of it...it's just the ajax that trips me up. thanks.
Spend 20 mins learning scriptaculous [spelling] or a similar ajax framework. Its pretty easy but works like this: You write a php script that does what you need, and returns a value. You then call a javascript function that does the following [using framework to make it easier] - Setup get / post variables to send to php script - Send ajax request - Receive ajax request - parse it and then show to user Which could work as follows: - Request myid.php?id=4 - Returns "timothy" [as a username] - You then show this to the user etc