Re: Array to string conversion error help needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



THANKS MUCH -  Stuart, Tom, unassailable007, David, and Lester 

!!!!!!!!!! WOW - so helpful Thanks again !!!!!!!!


> On Mar 8, 2016, at 10:56 AM, dealtek@xxxxxxxxx wrote:
> 
> newbie mysql select help needed.
> 
> 
> this works fine...
> 
> $sth = $pdo->prepare("SELECT * FROM table1 where id IN (1,2,3)"
> 
> 
> 
> but with an array like...
> 
> $mylist = array("1","2","3");
> or 
> $mylist = array(1,2,3);
> 
> these fail...
> $sth = $pdo->prepare("SELECT * FROM table1 where id IN $mylist"
> or
> $sth = $pdo->prepare("SELECT * FROM table1 where id IN ($mylist)"
> 
> 
> I get error : Array to string conversion...
> 
> Q: Can anyone help me fix this?
> 
> 
> --
> Thanks,
> Dave - DealTek
> dealtek@xxxxxxxxx
> [db-16]
> 


--
Thanks,
Dave - DealTek
dealtek@xxxxxxxxx
[db-16]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux