Lamez Posted January 27, 2008 Share Posted January 27, 2008 Is there a way to make a table have only one row, and when a form is submitted that alters that table, it does not add a new row, but modifys the current one? Quote Link to comment Share on other sites More sharing options...
eZe616 Posted January 27, 2008 Share Posted January 27, 2008 kind alike "UPDATE {table} SET name='dumbo' ,blog='something' ,etc.. WHERE id=3" ?? Quote Link to comment Share on other sites More sharing options...
Lamez Posted January 28, 2008 Author Share Posted January 28, 2008 what if the row does not exist? Quote Link to comment Share on other sites More sharing options...
revraz Posted January 28, 2008 Share Posted January 28, 2008 See my reply to your other post just like this. Quote Link to comment Share on other sites More sharing options...
toplay Posted January 28, 2008 Share Posted January 28, 2008 lamez do not post the same or similar topic more than once. If the primary key of your row is staying the same, then you can use a simple REPLACE (instead of INSERT and UPDATE). See manual: http://dev.mysql.com/doc/refman/5.0/en/replace.html Quote Link to comment Share on other sites More sharing options...
Lamez Posted January 28, 2008 Author Share Posted January 28, 2008 sorry I posted in PHP, but someone told me to post here, then they responded, so I kept it going as well, sorry Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.