You are here: Re: I keep getting this error in in_array. Any ideas why? « PHP Programming Language « IT news, forums, messages
Re: I keep getting this error in in_array. Any ideas why?

Posted by rich on 12/16/50 11:58

Oh here is the getspecprim() function

function getspecprim($dresstypeid) {
$getQ="SELECT primsecid FROM li_dresstypepsp
WHERE
dresstypeid= '$dresstypeid'";
$getR = pg_query($getQ);
$getA= pg_fetch_all($getR);
return($getA);
}

rich wrote:
> I keep getting the error:
> Warning: in_array(): Wrong datatype for second argument on line 679
> here is the code.
> I declare and fill the array
> $specprimA = array();
> $specprimA= getspecprim($dresstypeid);
> $primsecA=getprimsec();
>
> Then I do a compare using in Array. I even put in the extra step of
> making sure I have something in the array with the is sizeof statement.
>
> $numcl= count($primsecA);
> for ($i=0; $i<$numcl; $i++){
> $primsec = $primsecA[$i]['primsec'];
> if (sizeof($specprimA) >0){
> if (in_array($primsecA[$i]['primsecid'], $specprimA)) { ?>
> <input type="checkbox" checked tabindex="2" name="primsecid[]"
> value="<?php echo $primsecA[$i]['primsecid']; ?>"/><?php echo
> $primsec;
> } else { ?>
> <input type="checkbox" tabindex="2" name="primsecid[]" value="<?php
> echo $primsecA[$i]['primsecid']; ?>"/><?php echo $primsec;
> }
> } else { ?>
> <input type="checkbox" tabindex="2" name="primsecid[]" value="<?php
> echo $primsecA[$i]['primsecid']; ?>"/><?php echo $primsec;
> }
> }?>
>
> This is line 679
> if (in_array($primsecA[$i]['primsecid'], $specprimA)) { ?>
>
> Any ideas why?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация