Results 1 to 2 of 2

Thread: Retrieving checkboxes values from mysql

  1. #1
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Retrieving checkboxes values from mysql

    Hi All,

    I have been able to insert a checkbox value into my database. The problem i am now facing is how to retrieve the value of the checkbox in the form of a TICK.

    Your help will be much appreciated.

    Regards.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    You could do it like this

    PHP Code:
    <input type="checkbox" value="checked? 
    <?php
    if ($value_from_db == 1) {
    echo 
    "checked" }
    ?>
     />
    Corrections to my coding/thoughts welcome.

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
  •