anyone know how to add numbers up with PHP?

Nik

New member
By this I don't mean variables I can do that what I am after is this.

I have a log in script working fine but what I want is every time a person logs in, it before registering session variables pulls a number next to their details out of the database adds one to it and puts it back into the database. This is just a sort of way of knowing how many times a person has logged in sort of deal.

Any idea of the actual code to do this?(excluding the log in script)
just the adding part I know how to select from a db and insert into one. Usually languages use this or along these lines

$number = "2" $number ++

or something like that If you still don't know what I mean just contact me. I'll try to make it clearer.

here is what I got so far. from the if statment after sql query

$query = "SELECT amount-visited FROM login";
$result = mysql_query($query);

$number = $query;
$number + 1;
echo $number;

session_register("username");
session_register("password");
header("location:search.php");

other questions I have involve will it know which amount-visited row to select if I have more than one person in the DB or will I have to select the full row again in order for it to know.

Thanks
Basically as soon as a user registers with me their details are stored and they are logged in.

Once that happens they get a 1 next to their name meaning they have logged in once.

Then every time they log in there after 1 will be added per log in.

This is why I need to know how to pull the number they already have and add 1 to it.
 
Back
Top