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]
|