onestopplay
07-13-2009, 11:28 AM
This has been driving me CRAZY ever since I started working with PHP/MySQL.
Basically I need the code to connect to database, have a mysql_query statement with the whole SELECT * FROM .....
Now I then use $result = mysql_fetch_array. Whether or not I should use this is what I'm asking. But I need an if statement that basically says in simple terms:
if $var is not any of the rows in $result
{
//code
}
I could say
if $var != $result but that only works for one row in the database.
Basically I need the code to connect to database, have a mysql_query statement with the whole SELECT * FROM .....
Now I then use $result = mysql_fetch_array. Whether or not I should use this is what I'm asking. But I need an if statement that basically says in simple terms:
if $var is not any of the rows in $result
{
//code
}
I could say
if $var != $result but that only works for one row in the database.