liamloveslearning Posted July 21, 2010 Share Posted July 21, 2010 Hi all, im trying to call a number from a db, add 1 to it and then print it to the browser, I've been googling to no avail and ive been trying playing about, guesswork basically. At the moment im left with <?php $jobby = $row_gethighestworld['intrajobno']; $nxtjob = ('+1' . $jobby); echo $nxtjob; ?> Link to comment https://forums.phpfreaks.com/topic/208397-add-1-to-value-not-working/ Share on other sites More sharing options...
liamloveslearning Posted July 21, 2010 Author Share Posted July 21, 2010 Just tried this to no avail! <?php $c = $row_gethighestworld['intrajobno']; $d= $c + 1 ; echo $d; ?> Link to comment https://forums.phpfreaks.com/topic/208397-add-1-to-value-not-working/#findComment-1089007 Share on other sites More sharing options...
liamloveslearning Posted July 21, 2010 Author Share Posted July 21, 2010 okay finally got it working using <?php $newno = $row_gethighestworld['intrajobno'] += 1; echo $newno; ?> only now all instances of $row_gethighestworld['intrajobno'] are showing the value +1. I need just 1 instance of this to make the addition, it needs to be a unique variable if this makes sense? Link to comment https://forums.phpfreaks.com/topic/208397-add-1-to-value-not-working/#findComment-1089011 Share on other sites More sharing options...
liamloveslearning Posted July 21, 2010 Author Share Posted July 21, 2010 sorted! <?php $newno = $row_gethighestworld['intrajobno'] + 1; echo $newno; ?> Link to comment https://forums.phpfreaks.com/topic/208397-add-1-to-value-not-working/#findComment-1089013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.