Link to home
Start Free TrialLog in
Avatar of dsuthany
dsuthany

asked on

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\library\templates\nav_right.tpl.php on line 62

Hello Experts,
   I try to code php program for recently view items. and it can show the last items that user watched, but when i load this page the first time it will show error message as followed:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\library\templates\nav_right.tpl.php on line 62

I attached code. Please help me... Many thanks in advance.
<?
$gal_item_id=$_GET['gal_item_id'];
 
// insert codes to retrive title from gal_item_id
		$conn_mysql->db_connect(DB_SERVER_HOST, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_SERVER_DATABASE);
		# Mode SQL Command : Select data in condition
		$sql = " SELECT * from gallery_item where gal_item_id='$gal_item_id' ";
 
		$res['select_item'] = $conn_mysql->query($sql);		
		# Loop data in to variable : Fetch a result row as an associative array
		$arr['detail_item'] = $conn_mysql->fetch_row($res['select_item']);
			# Define variable for use easy
			$gal_item_title = $arr['detail_item']['gal_item_title'];
 
 
?>
 
<?
   $item_link="<a href='?module=gallery&action=info_item&gal_item_id=$gal_item_id'>$gal_item_title</a>";
 
if (! in_array($item_link, $_SESSION['articles']))
$_SESSION['articles'][] = "$item_link";
// Output list of requested articles
 
 
 
 
echo "<ul>";
foreach($_SESSION['articles'] as $doc) echo "<li>$doc</li>";
//echo "<p>$gal_item_title</p></p>";
echo "</ul>";
 
 
 
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of szewkam
szewkam
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dsuthany
dsuthany

ASKER

Many thanks szewkam ;-) Now i can slove the problem..Yahoo
I can slove the problem now. Thank you very much