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,
You are assigning the row to
$catidand later using$catId. Notice the capital “I”. You also need to make sure$catIdis an array becausemysql_fetch_arraywill returnFALSEif there are no rows.