Results 1 to 3 of 3

Thread: activate and deactivate a mysql table record using a checkbox or link

  1. #1
    Join Date
    Apr 2012

    activate and deactivate a mysql table record using a checkbox or link


    Sorry to ask for help again, have tried looking last night for this little issue

    I want to have a link or checkbox in the backend admin that shows or hides the table record from the front end but on the backend it shows as active or deactive and is easy for the admin user to make it active and deactive by clicking a checkbox or link

    Or same thing but archives the table record to a archive database and then the admin user can move it back from the archive database to the main database

    Is either ways possible, could someone point me in the right direction or send a link that could help me get started

    Kind regards


  2. #2
    Join Date
    Apr 2012

    I have managed to get the active field entered in the mySQL database using the SET type and entering active and inactive in the values part and managed to get the two radio buttons displayed in the php page but can't work out how to make the record inactive when click the inactive radio button

    The php code is below if it helps

    PHP Code:
    PHP Code:
    echo "<td><input type='radio' name='a'.$active . value='active'>Active <input type='radio' name='a'.$id . value='inactive'>Inactive"."</td>"

  3. #3
    Join Date
    Sep 2013
    You should treat it as an array like this,

    <input name="checkbox[]" type="checkbox" value="<?php echo $row['link_id']; ?>">

    Then only, you can take its count and loop it for activation or deletion.

    or can try out with the below one:
    <input type="checkbox" <?php echo ($condition) ? ' disabled="deletion"' : '';/>
    <input type="checkbox" <?php echo ($condition) ? ' enabled="activation"' : '';/>

    hope this helps.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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