web_master Posted May 19, 2008 Share Posted May 19, 2008 Hello, how can I update automatic generated (autoincrement) IP? - mean change it to another nr? The code below dont work thnxs T <?php $query_update = mysql_query("UPDATE `news` SET `news_id` = '".$_POST['news_id']."' WHERE `news_id` = '".$_POST['news_id']."' "); ?> Link to comment https://forums.phpfreaks.com/topic/106341-update-ip/ Share on other sites More sharing options...
BlueSkyIS Posted May 19, 2008 Share Posted May 19, 2008 UPDATE some_table SET some_value = (some_value + 1) WHERE id = 'an_id' Link to comment https://forums.phpfreaks.com/topic/106341-update-ip/#findComment-544995 Share on other sites More sharing options...
web_master Posted May 19, 2008 Author Share Posted May 19, 2008 OK, BlueSky but UPDATE some_table SET some_value = (some_value + 1) WHERE id = 'an_id' what if I want to change ID nr from 10 to 15 than from 15 to 11 ? Link to comment https://forums.phpfreaks.com/topic/106341-update-ip/#findComment-545001 Share on other sites More sharing options...
BlueSkyIS Posted May 19, 2008 Share Posted May 19, 2008 OK, BlueSky but UPDATE some_table SET some_value = (some_value + 5) WHERE id = 'an_id' what if I want to change ID nr from 10 to 15 than from 15 to 11 ? Link to comment https://forums.phpfreaks.com/topic/106341-update-ip/#findComment-545004 Share on other sites More sharing options...
947740 Posted May 19, 2008 Share Posted May 19, 2008 And if you want to subtract, you would use - 5. Link to comment https://forums.phpfreaks.com/topic/106341-update-ip/#findComment-545058 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.