Thalantyr Posted March 6, 2008 Share Posted March 6, 2008 Hi there, first time poster. I'm only new to PHP, and i'm having some trouble getting my head around how to properly edit an SQL row with PHP. Basically the page i'm designing is a member list for gaming which I want stored in a database. I know the basics of addings & viewing sql data, but editing & deleting has got me stumped. From what I can tell, I need to post back to the same page using CMD= and then based IF statements on what the URL is. Now that probably sounds simple to all of you, but I can't get it to work. I think my main problem is that i'm including 4 different PHP pages for different ranks. Is there some way I can create an array for each rank so I only need 1 x PHP page? Eg: Leaders, Core Members, Full Members, New Members I've currently got one page called memberlist_admin.php and it includes memberlist_leaders_edit.php, memberlist_coremembers_edit.php, etc... Those files basically have the code to say if(!isset($cmd)) { then do this block of code, which DOES work, and displays an EDIT link / DELETE link for me. The second I add the second statement in, which is along the lines of if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit") { if (!isset($_POST["submit"])) { then things really start to just not work, and the errors are along the lines of Parse error: syntax error, unexpected $end in /home/********/public_html/********/memberlist_leaders_edit.php on line 97. Where should I start? What's the best tutorial out there (besides Spoono, which I get lost it quite quick)? Thankyou. Greg Bennett. Quote Link to comment https://forums.phpfreaks.com/topic/94801-editing-sql-rows/ 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.