Jump to content

Editing SQL rows


Thalantyr

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.