Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jordanste

macrumors member
Original poster
Feb 25, 2006
83
0
hey folks, i was wondering if there was an easy way to execute some php on a link click, without a form. for example, if i wanted to delete a row in mysql by clicking a link. i have done some mild searching around for an answer to this and come up blank. im most likely thinking about it too hard, there is probably a really simple solution that im overlooking. let me know if you can help.
 
I don't specifically know how to do this, but I can guide you to something that may shed some light on it.

phpMyAdmin is a very popular program for the care and feeding of mysql installations, and it's an open source program. Google it for their web site, download it and take a look.

Hope this helps...
 
Just link to another PHP page and at the top of that page insert some PHP/MySQL to delete the row you want.

If you want to delete rows without the user leaving the page, you'll have to look into AJAX.
 
It is pretty easy actually.

You could put up a delete link such as deleteuser.php?id=3 where 3 is the id of the row you want to delete. Do note that such method has a huge flaw though, people could just change the id and they can delete another user. If you are going to be using this method, make sure that you have backed it up with strong security.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.