close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Problem with an insert and update on same page

Thread began 2/09/2013 5:11 pm by mrs | Last modified 2/11/2013 7:23 pm by mrs | 1491 views | 5 replies

mrs

I have built a forum, and it works well apart from a couple of things. I want to be able to display how many replies have been submitted, and when they were submitted. Because I am only displaying the initial thread post on the results page (just as this forum does), I need to be able to update the original records date so that it then appears at the top of the results page with the amount of replies displayed... a bit of user friendliness really. I can't use timestamp because I already have a counter in place that increments by 1 each time the page is viewed. As a result, auto updating a timestamp would falsely reorder the results page.

The original thread and its replies all come from one table and I am relating them by a thread ID linking to the original post ID

So, that's my reason for the insert and update from the same form post and only needing to update those two columns.

I did try a recordset (rs_replyID) to give me the record that I want to update, but it returned an ID of '0' in the URL rather than the correct ID and caused an error when inserting and updating. I chose to use $_SESSION['USES_threadID'] which actually updated the correct record, but only with 0's. So I assumed I had done something wrong in the Update Single Record wizard. I didn't actually think that I'd need to use a recordset for this as they only retrieve content from the DB don't they?

Is update and insert from one form post possible with MySQL? I am told it's possible with SQLServer by a .NET expert I know, and he can't see why it should be in MySQL, but, I know there's differences between SQLServer and MySQL.

Does the order have an effect on locking the table? I have it in update first, then insert... should it be insert then update?

OR... have I simply entered the wrong code into the wizards Binding Panel value? Is NOW() valid code to enter there?

Thanks

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...