moisesbr Posted October 21, 2013 Share Posted October 21, 2013 Hi I would like to increment chave Nei column with +1 in table controle, every time an event happens. I tryied command below but it results error: result = mysql_query("UPDATE controle set chave_nei= chave_nei + 1") ; Moises Link to comment https://forums.phpfreaks.com/topic/283166-increment-column/ Share on other sites More sharing options...
AbraCadaver Posted October 21, 2013 Share Posted October 21, 2013 On 10/21/2013 at 9:00 PM, moisesbr said: but it results error: OK Link to comment https://forums.phpfreaks.com/topic/283166-increment-column/#findComment-1454843 Share on other sites More sharing options...
cyberRobot Posted October 22, 2013 Share Posted October 22, 2013 Is the error caused by the missing "$" before "result"? <?php $result = mysql_query("UPDATE controle set chave_nei= chave_nei + 1"); ?> If not, what is the error you are receiving? Side note: the mysql_ functions have been depreciated. If you're not doing so already, you should start looking into the alternatives: http://www.php.net/manual/en/mysqlinfo.api.choosing.php Link to comment https://forums.phpfreaks.com/topic/283166-increment-column/#findComment-1454927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.