Jump to content

Add 1 to value not working


Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.