/    Sign up×
Community /Pin to ProfileBookmark

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

Hi

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

Ian

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ianhaneyauthorNov 21.2013 — Hi

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

[code=php]
$active= $row['active'];
[/code]


[code=php]
echo "<td><input type='radio' name='a'.$active . value='active'>Active <input type='radio' name='a'.$id . value='inactive'>Inactive"."</td>";
[/code]
Copy linkTweet thisAlerts:
@priyankagoundNov 22.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.
×

Success!

Help @ianhaney spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...