Petsmacker Posted March 19, 2006 Share Posted March 19, 2006 [code] <?$box1=mysql_result($b,0,"box1");$box2=mysql_result($b,0,"box2");$os = compact('box1', 'box2')?><table width=60%><tr><td bgcolor=#00FFFF><center><b><? if (in_array("0.01", $os)){echo "0.01 Galleons";}?></b></center></td><td><center><img src="images/dond/divide.gif"></center></td>[/code]This is a very simplified version of the code but basically it keeps showing me:[b]Warning: in_array(): Wrong datatype for second argument in /home/xxx/public_html/dond.php on line 21[/b] in the in_array() function. Can anybody help?And YES, the mysql_result IS picking up the database data correctly. Quote Link to comment https://forums.phpfreaks.com/topic/5286-array-help/ Share on other sites More sharing options...
kenrbnsn Posted March 19, 2006 Share Posted March 19, 2006 What do you expect to be returned by the line[code]<?php $os = compact('box1', 'box2')?>[/code]Put the code [code]<?php echo '<pre>' . print_r($os,true) . '</pre>'; ?>[/code] right after it and see if you're getting what you expect.Ken Quote Link to comment https://forums.phpfreaks.com/topic/5286-array-help/#findComment-18816 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.