Jump to content


Query fine but something I don't understand

  • Please log in to reply
1 reply to this topic

#1 mr. big

mr. big
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 24 August 2006 - 07:09 PM

I made a php form to edit articles in my MySQL database, with a $_GET passthrough of variable $id, which represents the primary key for the table.

At the end of the form, after the hidden "submitted" input, I have a line
echo '<input type="hidden" name="id" value="' . $id . '" />

The query won't perform the update without this line, and I just wondered what it does, theoretically.  I was having a terrible time until I started looking for scripts and saw this somewhere.
"Every monkey thinks its children are beautiful."

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 August 2006 - 09:58 PM

Apparently, your script is using this FORM input value to figure out which database record to edit -- if you don't submit this field with the form, it won't "work".
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users