how to update in checkboxes??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

how to update in checkboxes??

Post by PHPycho »

i have listout the designation of user in checkbox with auto checked in respective field.
i have table named

Code: Select all

users(id,username,......)

and

Code: Select all

users_designation(id,user_id,designation..)
While in edit section, i am feeling a bit difficulty in editing..
i am thinking to delete all the previous values in users_designation table and
to insert the freshly checked ones..i am doing right or there is an alternative way..
i am awaiting for your help.
Thanks in advance to all of you..
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

I'm a bit confused about what you're doing...

If it's what I think you're doing, why not just use the primary key of the users table?
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Post by PHPycho »

users is the table name and the things in the () are fields and same case for users_designation.
I dont know in what you are confused.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

PHPycho wrote:users is the table name and the things in the () are fields and same case for users_designation.
I dont know in what you are confused.
The description of your problem is ambiguous. What exactly is it that you are doing? What is stored in users_designation?
PHPycho wrote:i have listout the designation of user in checkbox with auto checked in respective field
What does that mean?
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Post by PHPycho »

sorry if i am not clear.
i will try once again..
i have two tables name users and users_designation
-users table has fields like id,username,password....etc
-users_designation table has fields like id,user_id,designation

case:
a user may have more than one designation...

Problem:
*In EDIT section of users, the values are retrieved from the tables,
but for the designation all the designation are shown in checkbox style
with respected field autochecked..
*when the user changes the designation while checking the checkbox, then
there is difficulty in updating the designation

whats the solution?
i tried to delete the existing designation and inserted the fresh ones..
i dont know whether this method is perfect or not...

Any help and suggestions are warmly welcome
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Can you paste a link to one of the pages?
Post Reply