php - making an array from database -


i'm going crazy issue, want array separated commas(string) example:(1,2,4,6) database , insert variable inside query like(select table id in($variable string). can me this?

example:

<?php //connect $sql = "select id users id=1"; //get results array 

insert variable inside query

select table id in($variable); // ?> 

i tried multiple ways , have different issues. please need answer!

implode()transforms array string of values separated char choose:

$arr = array(1,2,3,4,5,6,7,8,9); // make array $list = implode(',',$arr); $sql = "select * table id in($list)"; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -