|
-
May 4th, 2007, 05:51 PM
#1
Thread Starter
Lively Member
[RESOLVED] Really simple IF
I'm going crazy here. I know this is really basic but...
I wan't to check if a SQL result contains as string.
Code:
IF $result contains $_SESSION['name']
{
Do **** here
}
Thanks
FORZA ROSSONERI! CAMPIONI!!!
-
May 4th, 2007, 06:30 PM
#2
Re: Really simple IF
If statements are structerd like this.
php Code:
if(condition)
{
// True
}
else
// False
}
-
May 4th, 2007, 09:10 PM
#3
Re: Really simple IF
If $result is a string:
PHP Code:
if (strpos($result, $_SESSION['name']) >= 0) {
// ...
}
If $result is an array:
PHP Code:
if (in_array($_SESSION['name'], $result)) {
// ...
}
Last edited by penagate; May 4th, 2007 at 09:14 PM.
-
May 5th, 2007, 05:26 AM
#4
Thread Starter
Lively Member
FORZA ROSSONERI! CAMPIONI!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|