Jump to content
MakeWebGames

in array() expects at most 3 parameters, 11 given


boionfire81

Recommended Posts

$IDs=('18','16','15','13','3','4','2');
$gk=$db->query("SELECT * FROM itemtypes");
$itype=$db->fetch_row($query);

while (in_array($itype,$IDs))
{

 

All I'm getting there

Parse error: syntax error, unexpected ',' in

That is the $ID line. I tried moving the line above the other lines and the error line number just changed with it.

Link to comment
Share on other sites

$items = array_unique(array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22));
$itemtypes = $db->query("SELECT `itmtypeid`,`itmtypename` FROM `itemtypes` WHERE `itmtypeid` IN(".implode(',',$items).")");
if($db->num_rows($itemtypes)) {
   // use the num rows to check if its real
   while($itm = $db->fetch_row($itemtypes)) {
       // success run whatever it is you are trying.
   }
}
else {
  // failed
}

 

just change the ids to whatever you want to show or you can alter the query and make it say NOT IN and then have your ids you wish to block.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...