Reputation: 67
I wrote the following, but its saying that its the 'wrong datatype'.
Could someone tell me where im going wrong.
$newQuery = mysql_query("SELECT * FROM table WHERE left_id='$authId'");
$catid = mysql_fetch_array($newQuery);
if(in_array("99", $catId)){
// A Director
} else {
// A Researcher
}
Cheers,
Upvotes: 0
Views: 417
Reputation: 6571
You are assigning the row to $catid
and later using $catId
. Notice the capital "I". You also need to make sure $catId
is an array because mysql_fetch_array
will return FALSE
if there are no rows.
Upvotes: 8