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? Link to comment https://forums.phpfreaks.com/topic/88004-one-row/ Share on other sites More sharing options...
cooldude832 Posted January 27, 2008 Share Posted January 27, 2008 yes you can, its not uncommon for flat config files to be converted into mysql single row tables however this is a php board this is a mysql board. Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450257 Share on other sites More sharing options...
Lamez Posted January 27, 2008 Author Share Posted January 27, 2008 I understand, but I thought you had to do this through php? Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450265 Share on other sites More sharing options...
cooldude832 Posted January 27, 2008 Share Posted January 27, 2008 what in the mysql handbook implies it must run through php? Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450272 Share on other sites More sharing options...
Lamez Posted January 27, 2008 Author Share Posted January 27, 2008 I know it doesn't, but I was saying I thought you had to do what I wanted to do in PHP. You do not have to be a jerk about it. I just do now know how to do this, and I would like it if someone pointed me in the right direction. -Thanks Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450274 Share on other sites More sharing options...
cooldude832 Posted January 27, 2008 Share Posted January 27, 2008 I know it doesn't, but I was saying I thought you had to do what I wanted to do in PHP. You do not have to be a jerk about it. I just do now know how to do this, and I would like it if someone pointed me in the right direction. -Thanks I think I gave you a very good point in the right direction on this one how the data goes in doesn't matter because if you have 1 row with a rowid one and you say update where rowid = 1 or just update it will update all rows so all rows = 1 row in this case. Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450278 Share on other sites More sharing options...
Lamez Posted January 27, 2008 Author Share Posted January 27, 2008 but it creates a row, then they can go back and edit that field. so what would the PHP code look like? I have never done anything like this Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450617 Share on other sites More sharing options...
revraz Posted January 27, 2008 Share Posted January 27, 2008 If you have an existing row, and you want to modify that row, just do a UPDATE function on it. 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? Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450656 Share on other sites More sharing options...
Lamez Posted January 28, 2008 Author Share Posted January 28, 2008 I know, but the row does not exist yet, that is what I am say Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450854 Share on other sites More sharing options...
revraz Posted January 28, 2008 Share Posted January 28, 2008 I think you are looking for this? http://forums.mysql.com/read.php?97,134814,134814 I know, but the row does not exist yet, that is what I am say Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450895 Share on other sites More sharing options...
toplay Posted January 28, 2008 Share Posted January 28, 2008 Do not double post...topic closed. Members can reply to his other one in the correct topic area: http://www.phpfreaks.com/forums/index.php/topic,179255.0.html Link to comment https://forums.phpfreaks.com/topic/88004-one-row/#findComment-450926 Share on other sites More sharing options...
Recommended Posts