navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

insert second time

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> insert second time
Page: [1]
 
Guest


 
insert second time - 3/15/2001 23:25:00   
i have a tbl_QA: name, questions, answers, date.

on my get_question.asp, i was able to insert name, questions, date sucessfully. (obvious answers aren't available yet)

i also have another page display all the questions for people to answers. once they submit answer, i want this answer to go into the samet table tbl_QA, verything stays the same except now "answers" now has just been filled.

at first i thought, i should do insert but insert gave me another record with everything blanks except answers field.

then i thought about update the current table, but it won't work due to some reasons. my query:
UPDATE tble_QA
SET answers='::answers::'
WHERE id=::id::

please help
thanks

Guest


 
RE: insert second time - 3/15/2001 13:02:00   
The problem seems to stem from your WHERE clause in that there is no ID field in your tbl_QA. For an UPDATE to statement to occur, you must match the inserted data with existing data in one of the fields. Thus, there reason you are getting a new entry instead of an update is this missing link. I would add another field to the tbl_QA to the effect of QUESTION_NUM which gives a unique number to all the questions submitted to the database. Thus, when a reply is posted to the database, you can update the answer field based on this QUESTION_NUM. You could do this by name if they are unique...and think using the question field wold be too long.

There are many ways to do this...but the key is matching the field to be updated with data from an existing field in the same record.


(in reply to Guest)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> insert second time
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts