Hi everyone,
I'm cureently working on a project for computer calss,we are building a website... it's on locachost.
so I came across something I couldn't figure how to create.
Basically I need to create an admin page , which Enables me to see all the users and delete\update their information.
I'm on the half way and i''m pretty stuck.
What I've done :
Made the session thing so that it ensures I'm an admin.
I was able to show in a table all the users from my database.
What I need to do:
Make a Radio button near every user, the one that is checked,is the one that the button "delete" will affect on, and it will IT from the database.
also the user that is checked by the radio button, will be also affected by the Update button , which will open a windows same as the registration window but with all values enterred, and just some things to change.
(I want to make the users' data Changeable "LIVE" in the table of the users' data , but it's hard, so I'll pass on it)

So any body with Ideas?
I don't know how can I make using the radio button, to point out exactly which user to delete.
Any help is appreciated
thank You,
Jc

Recommended Answers

All 3 Replies

JooClops,

When you create the radio button, assign it a value of the database id for that user. I am assuming that you have an autonumber value in the database for each user when they get created. If this is the case, then when you lookup the value for the user, use the autonumber field as the value for the radio button.

<% Do While Not rs.EOF %>
<input type="radio" name="userid" value="<%=rs("userid")%>"> 
<%
rs.movenext
Loop
%>

This way, when you click the delete button, this submits the value of the radio button userid. When you delete the database record, you use this value and your source of deletion.

Hope this helps.

oh cool ,
didn't think about that , well my users are not auto numbered so i need to add it myself , anyway i need to give out my project in a few hours, so i cant really change anything :<
but thanks
JC

It don't have to be an autonumber field, that's just usually how they are numbered. However you are doing the lookup, I would use the identity field that you set for each user to lookup the value and set that value in the radio button. This will work exactly the same for the update button too.

If this helped you out, please mark this thread as solved.

Thanks,

JSV

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.