Dymantic Varibles

Here is the code I am currently using:
[php]
IF ($name == “JasonSchom”) { $jason = $jason + 1; }
IF ($name == “MattDilly”) { $matt = $matt + 1; }
IF ($name == “JasonSmith”) { $jasons = $jasons + 1; }
IF ($name == “KyleSmalls”) { $kyle = $kyle + 1; }
IF ($name == “JoelNight”) { $joel = $joel + 1; }
IF ($name == “AdamGerma”) { $adam = $adam + 1; }
[/php]

Basicly I had a database of the userlist now in mysql. where $username now holds “JasonSchom” anyway I could use $username[i] to keep the inc value?

Thanks,
Jason

Not exactly sure what your trying to do, but if your trying to add 1 to whichever user is logged in then maybe something like this.

[php]<?php

$username=“whatever”;

If (!(isset($username))) {
Echo “No string in $username”; //if $username is empty
}
else {
$points=$username+1; //adds 1 to username and assigns it to $points
}
?>[/php]

Actaully this is very close to what I am looking for however, what this is for is, I currently have 7 people in a football pool, I am wanting to count each win from $username witch loops through all the games in mysql.

If you like i can post the entire code of the webpage if you like to see what I have done so far…

Actaully! I think i figured it out… I am not good with arrays, but I think i figured it out :slight_smile: I will keep you posted

cool, good luck!

Sponsor our Newsletter | Privacy Policy | Terms of Service