What is the best way to insert into and update a single row table in MySQL?

INSERT INTO table(col1,col2,col3) VALUES(val1,val2,val3) ON DUPLICATE KEY UPDATE col1 = val1, col2 = val2, col3 = val3.

Thanks for the good tip. Unfortunately, this is a Wordpress plugin, and the db session is already open and initialized. – Brian Reindel Nov 17 '08 at 3:07.

The Best Way is time well spent. The best way to is to start contributing patches based.

If your table will only ever have one row, you might consider preloading initial data into the row in your database creation script. Then your code will only ever need to issue an UPDATE statement. Also, you will not need a primary key column because there is only ever one row.

You can then issue UPDATE statements without needing a WHERE clause, too.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions