Okay hopefully easy one..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
teezilla
Forum Newbie
Posts: 6
Joined: Tue Feb 03, 2009 2:48 pm

Okay hopefully easy one..

Post by teezilla »

I want to to add 1 to every returning PID.. not the value 1 but change 214 to 215. and if it returns again 215 to 216.

Any Ideas would be greatly appreciated...
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Okay hopefully easy one..

Post by papa »

$pid += 1;

You need to provide a little more information than that.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Okay hopefully easy one..

Post by RobertGonzalez »

You are incrementing your value. In PHP there are a few ways to increment:

Code: Select all

<?php
$val = 1;
$val = $val + 1; // You could use any number, not just one
$val += 1; // Again you could use any number here
$val++; // This adds one, but only after $val is evaluated by the engine
++$val; // This adds one before $val is evaluated by the engine
?>
Post Reply