SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    check box problems???

    i had made a edit portion..
    which retrieves all the data from the mysql.
    everthing goes ok except the check box....
    it should autocheck that checkbox button for which value has been inserted into mysql...i had made the 4 fields for the checkbox which stores the Null value defualt
    My Question goes below
    >>how to auto check the checkboxes with attribute "checked" after retrieving the data from the mysql
    >>whether i should use the four fields for the four checkboxes or one field is sufficient
    Got some idea??? then help me with neccessary illustrations

  2. #2
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you would need some kind of test e.g.

    PHP Code:
    $is_checked = ($mysql_field 1) ? "checked" ""
    then just use the cvalue of is_checked in your checkbox declaration


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •