Manipulating database records using a checkbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ITStudent
    New Member
    • May 2007
    • 1

    Manipulating database records using a checkbox

    hi..

    I am new in PHP.. I am programming for my graduation project..

    how can I bind check box to table in html form, so when check on any record, I can do any operation I want, such as update, delete, etc.

    I am using PHP with Oracle DB..
    Thank u, and I hope a quick reply..

    My regards

    IT Student
  • rug
    New Member
    • May 2007
    • 6

    #2
    Originally posted by ITStudent
    hi..

    I am new in PHP.. I am programming for my graduation project..

    how can I bind check box to table in html form, so when check on any record, I can do any operation I want, such as update, delete, etc.

    I am using PHP with Oracle DB..
    Thank u, and I hope a quick reply..

    My regards

    IT Student
    Hello,

    You can do this using:
    [code=html]<input type="checkbox" name="mycheckbo x" value="records-unique-id">[/code]

    If you want to make the check box be checked by default do:
    [code=html]<input type="checkbox" name="mycheckbo x" value="records-unique-id" checked>[/code].

    When generating the table use a loop to add the check boxes and use the value (which should contain your records unique ID) to apply whatever processing you require.

    Hope this helps,
    rug

    p.s: Helping with homework is a bad thing. :( So next time, in order for you to learn yourself, try researching (via google) and then if you hit a problem, consult the forums).
    Last edited by pbmods; May 19 '07, 04:03 PM. Reason: Please use CODE tags when posting source code. Thanks!

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Originally posted by rug
      p.s: Helping with homework is a bad thing. :( So next time, in order for you to learn yourself, try researching (via google) and then if you hit a problem, consult the forums).
      This is true, altough, helping people with homework is ok, as long as we are explaining how to write the code rather that writing it for them. So your responce was pretty good.

      Thread titles, however, should descripe the topic of the thread. "PHP help" is not a good title, as it explains nothing and will return nothing if our fellow members are searching for a similar problem. It is also more likely that the thread will catch the eyes of our Experts if they are propperly named.
      Which is why I have edited the title of this thread.

      These rules, aswell as our complete list of rules, can be found in our Posting Guidelines, which every member should read through attleast once.

      MODERATOR

      Comment

      Working...