INeedAGig Posted March 22, 2011 Share Posted March 22, 2011 Okay, I have been following this tutorial: http://www.freewebmasterhelp.com/tutorials/phpmysql/1 to achieve exactly what I wanted to get done. I also followed the way to have it formatted in tables and added extra columns that I needed, included an "Options" column which houses three links, including "edit" and "delete" Now, I have everything working fine but I am stumped on how to get the "edit" and "delete" links to work for each individual entry that is listed. I have to have these features so the entries can be edited and deleted without having to physically go into the MySQL database to do it. The tutorial explains how to do it in Step 6, but I am confused. I'm not quite sure where to place the code for the links, which are generated automatically every time a new entry is inputted into the database. Anybody available to help me out? Thanks! Quote Link to comment Share on other sites More sharing options...
INeedAGig Posted March 22, 2011 Author Share Posted March 22, 2011 Any ideas?? Quote Link to comment Share on other sites More sharing options...
jamesjmann Posted March 22, 2011 Share Posted March 22, 2011 You can use get and make the links like this: <a href="?action=edit">edit info</a> Then write an if statement thats says If ($_get["action"] == "edit"{ Info_edit($_GET["username"]); } function info_edit($username){ query database and fetch array of every member where username = $username Use variables to display members information and do so in text fields Enclose all info in form tags <form action="?action=update&username=$_session["user"]" method="post"> </form> if ($_get["action"]=="update") { update_info($_get["username"]; } Function update_info($username) { process form information and update it in table where username=$username; } And that should work. Of course u mIte nneed to tweak it a bit... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.