kev wood Posted May 30, 2008 Share Posted May 30, 2008 does the update function need the where clause added to it or can it just be run with this syntax mysql_query =(UPDATE email_count SET sent_messages = $i); Quote Link to comment Share on other sites More sharing options...
peranha Posted May 30, 2008 Share Posted May 30, 2008 you can run it like that, but it is going to update everything in sent_messages to the value of $i Quote Link to comment Share on other sites More sharing options...
kev wood Posted May 30, 2008 Author Share Posted May 30, 2008 that is the only thing stored inside the table so it should work fine. the update will stop it from storing more than one value inside the table as well will it not??? Quote Link to comment Share on other sites More sharing options...
blirette Posted May 30, 2008 Share Posted May 30, 2008 the update will stop it from storing more than one value inside the table as well will it not??? I don't get that sentence... if you make an INSERT, yes there'll be two rows now and your UPDATE will update the two rows. All the rows in the table specifiied in your UPDATE. Quote Link to comment Share on other sites More sharing options...
peranha Posted May 30, 2008 Share Posted May 30, 2008 what ever the value of $i is is what the sent_messages field will be. If there are more than 1 row, then all rows will be set to the value of $i ex if more than 1 row with your current update script. $i = valuei id sent_messages 1 value1 2 value2 3 value3 will become id sent_messages 1 valuei 2 valuei 3 valuei Quote Link to comment Share on other sites More sharing options...
kev wood Posted May 30, 2008 Author Share Posted May 30, 2008 sound sorry for being a bit of n0b when trying to explain i should read things back to myself first to make sure it makes sense. thanks for the reply anyway it has answered my question. 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.