473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

automatically overwrite row

I have a database with submissions inserted from a web server.
If a submission is made again (i.e. with same user_id and problem_id), I want it to overwrite the row in the database. Currently, when I try to make the insert statement again, it obviously just fails and gives me a duplicate row error. As I don't know if a row is going to exist or not, is there a simple way to automatically insert/overwrite?

Thanks, Wes
Jul 11 '07 #1
3 7229
pbmods
5,821 Expert 4TB
Heya, wesomon99.

MySQL has exactly what you're looking for:
http://dev.mysql.com/doc/refman/5.0/en/replace.html
Jul 12 '07 #2
Heya, wesomon99.

MySQL has exactly what you're looking for:
http://dev.mysql.com/doc/refman/5.0/en/replace.html

Oh wow...replace will also insert...
Well thank you for clearing this up for me.
~Wes
Jul 12 '07 #3
pbmods
5,821 Expert 4TB
Heya Wes.

No problem.

Good luck with your project, and if you ever need anything, post back anytime :)
Jul 12 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jeff | last post by:
Could someone help me out with automatically overwriting files when using a MS Project VB macro? As you can see, I have the file saving to native format, then to a HTML file. When it goes to save...
5
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or No in the 'overwrite' message box? Everything...
4
by: jadiyo | last post by:
Hi, I've read many questions about how to automatically open a new window from a page using the JavaScript onLoad command. Unfortunately, due to the web application framework being used...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
2
by: B-Dog | last post by:
Is there a way to make vb.net to overwrite the file when moving? Here is what I'm trying to do: If System.IO.File.Exists(dest) Then 'handle overwrite here If MessageBox.Show("Do you want...
1
by: Aere | last post by:
Hello, I'm coding a program that saves information about my patients, so i created a rich textbox for every field. (Name, Tel, etc). The program saves a .txt for each field, no matter if there is...
2
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the execution stream I would do... someFunction = function...
2
by: naivewisdom | last post by:
I'm writing a program that needs to overwrite a file at the end of each usage. Currently, the program work as a whole, except at the end of each game, when the overwrite method(shown below) is...
4
by: Tinus | last post by:
Hi I have a php code that uploads a file to mysql db then I detrmine the id of the last inserted file and download the file .e user is asked if he wants to save the file and then asked for te...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.