shane18 Posted September 22, 2009 Share Posted September 22, 2009 Lets say i have a table.... Mail_Usage Date // E_Mails how can i make it so anything a e-mail is sent from my server it adds 1 to the E_Mail for todays date.... for example something like mysql_query("UPDATE Mail_Usage set E_Mails++ WHERE Date='$DATE'"); would that work? i don't have access to my site from school cuz its blocked Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/ Share on other sites More sharing options...
mikesta707 Posted September 22, 2009 Share Posted September 22, 2009 mysql_query("UPDATE Mail_Usage set E_Mails=E_Mails + 1 WHERE Date='$DATE'"); I believe that will do that trick Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/#findComment-923077 Share on other sites More sharing options...
shane18 Posted September 22, 2009 Author Share Posted September 22, 2009 Thanks for the quick reply.. would E_Mail=E_Mail++ also work? Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/#findComment-923079 Share on other sites More sharing options...
mikesta707 Posted September 22, 2009 Share Posted September 22, 2009 I don't believe MYSQL supports the decrement/increment operators like most programming languages do. Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/#findComment-923083 Share on other sites More sharing options...
shane18 Posted September 22, 2009 Author Share Posted September 22, 2009 thats lame... lol having to do BLAH = BLAH + 1 instead of BLAH++ or BLAH = BLAH++ Anyone know if any of that is supported? Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/#findComment-923087 Share on other sites More sharing options...
shane18 Posted September 22, 2009 Author Share Posted September 22, 2009 its ok ill experiment with what works. Quote Link to comment https://forums.phpfreaks.com/topic/175144-solved-mysql-math/#findComment-923099 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.