Re: Variable in Select statement?
On Mon, 01 Oct 2007 11:49:26 +0200, Captain Paralytic
<paul_lautman@yahoo.com> wrote:
> On 1 Oct, 10:46, GarryJones <mor...@algonet.se> wrote:
>> Great, that worked.
>>
>> The next problem is I now need to test for a value in the select
>> statment to see if it is in an array.
>>
>> $ml_collect_ind="SELECT * FROM ml_lopp WHERE scfmnum=$scfchknum AND
>> ((in_array(loppnum, $arr_motlopp))=TRUE) ORDER BY sank, loppnum";
>>
>> This should return all fields where 'scfmnum' is $scfchknum and the
>> associated value 'loppnum' is in the array.
>>
>> Needless to say its syntax again..
>>
>> Any much appreciated
>>
>> Garry Jones
>> Sweden
>
> $ml_collect_ind="SELECT * FROM ml_lopp WHERE scfmnum=$scfchknum AND
> " .
> ((in_array(loppnum, $arr_motlopp)) . "=TRUE) ORDER BY sank, loppnum";
Huh?
$ml_collect_ind = "SELECT * FROM ml_lopp WHERE scfmnum=$scfchknum AND
loppnum IN (".implode(',',$arr_motlopp).") ORDER BY sank, loppnum";
--
Rik Wasmus
|