Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to improve my page, please help. 1

Status
Not open for further replies.

bilebalar

IS-IT--Management
Mar 25, 2002
386
US
hi,

i just finished programming my first asp survey but there are couple of things i want to improve but not sure what to do. any help is greatly appreciated! i have searched through the whole thread but couldn't find anything that i can understand.

first, a little info about the survey...

i have a page where user can log in to update/delete/add info whenever they want. each user has an unique id, every record is marked with this id.

how do it...
1) when the user add/update a record, how can i insert the current date/time into a column called TIME in my database along with the data?

2) i have a CHECK ALL THAT APPLY question. right now, i have a column for every option (V1, V2, V3...). the data is saved to the db successfully and there's no problem displaying the correct checkboxs checked. Is there anyway to do it with just 1 column? my problem is that if i have
(for example: happy,sad,mad) in the column, when the data is returned to the table, the happy, sad, or mad boxes are not checked. so i guess my question is is there a way to split
the data in a column and return it to the table so the right checkboxes are checked?

thanks in advance.


 
q2. save the checkbox name as the same name then when insert you just do something like this


"update tblname set answer='"&request.form("checkbox")&"'" where ..."

it will automatic insert as an array ie. happy,sad,mad
 
you split

arr=split(rs("answer"),",")

<input type="checkbox" value="<%=arr(0)&>">


<input type="checkbox" value="<%=arr(1)&>">

....
 
<input type="checkbox" value="<%if arr(0)="happy" then response.write(arr(0))%>">

also on my previous post fix the &> pat to %>
 
you need to normalize the database...creaqe another table called answers and link to the other table and create a join statement to query the answers for each unique record, instead of stuffing all answers in one row/column...this defeats the purpose of a database. like steven said use the time or date function to use as a timestamp. asign to a variable and when you use sql insert put the varaible in accordingly.

timestamp = time

Good Luck,

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top