Eiolon wrote:
> Using DW8, PHP and MySQL.
>
> I created 3 radio button options:
>
> 1. Suspended for 24 hours
> 2. Suspended for 3 days
> 3. Suspended for 5 days
>
> I want to be able to select one of those options and
save it. When I go to
> look at the persons profile, it will tell me when they
can be unsuspended.
This is very simple to do in MySQL. Add a DATETIME column to
the table
that lists users' details. Call it something like
active_date. Then
update the table like this:
UPDATE users SET active_date = NOW()
That gives everyone an active_date of the current date and
time.
When you suspend someone, set the value of the radio buttons
as 1, 3, and 5.
Use the following SQL:
UPDATE users SET active_date = DATE_ADD(NOW(), INTERVAL
param1 DAY)
WHERE user_id = param2
Set param1 as the value of the radio button and set the type
to numeric
(if you're using DW 8.0.2). Set param2 to the value of the
user_id
(also numeric).
You can check if the user is suspended by comparing
active_date with NOW().
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/