I'm going crazy here. I know this is really basic but...
I wan't to check if a SQL result contains as string.
ThanksCode:IF $result contains $_SESSION['name']
{
Do **** here
}
Printable View
I'm going crazy here. I know this is really basic but...
I wan't to check if a SQL result contains as string.
ThanksCode:IF $result contains $_SESSION['name']
{
Do **** here
}
If statements are structerd like this.
php Code:
if(condition) { // True } else // False }
If $result is a string:
If $result is an array:PHP Code:if (strpos($result, $_SESSION['name']) >= 0) {
// ...
}
PHP Code:if (in_array($_SESSION['name'], $result)) {
// ...
}
Thanks penagate.