This content has been marked as final. Show 5 replies
Your post does not provide enough information. What are you doing now?
ok, for example:
you have a web page with a form where users can type a comment and under the form you have previous users comments. im trying to set it up so when an user posts a comment, the comment will be displayed immediately after the form is submitted.
i dont know if you need to take a look at my insert code but just in case you do here it is.
<cfquery name="insertpost" datasource="myData">
insert into posts (stamp, message, username) values (#now()#, '#form.comment#', '#form.username#')
What is more relevent is,
Is your form submitting to itself or to the same page?
What code comes after the insert query?
Is there a select query that gets the users comments? If so, does it run before or after the insert?
the form is submitting to the same page, and after the insert query i have the query to display the comments. heres the set up:
THIS IS DATABASE FOR THE COMMENTS
<cfquery name="displaycommentinfo" datasource="dgr">
THEN I HAVE THE FORM AND UNDER THE FORM IS THIS INSERT CODE
<cfif good is 1>
<cfquery name="insertpostinfo" datasource="dgr">
insert into posts ( message) values (#form.comment#')
UNDER THAT IS IS MY DISPLAY CODE
AND THATS IT.
There is your answer.
First you query the database.
Second you display a form.
THEN you insert the new comment from the previous form submit.
Finally you display the results of your query done in the first step,
before any new data was added.