Forum Moderators: coopster
$db= new MySQL($host,$dbUser,$dbPass,$dbName);
$sql=("SELECT * FROM sticker_files WHERE sticker_cat_id='8'");
$catdirs = $db->query($sql);
$dirs=$catdirs->fetch()
and I need a for each loop (i think)
to insert that data below:
$params = array(
'mode' => 'Jumping',
'perPage' => 3,
'delta' => 2,
'itemData' => array(****RESULTS HERE AS COMMA SEPARATED string)
);
Thank for help
I think it is a for each value of key as result or something
With standard mysql functions, you would just get an array
$result = mysql_query($sql);
$array = mysql_fetch_assoc($result);
In that case there's nothing to do. If you're in PHP5, you can also iterate through an object with a foreach and put it into an array that way.
Other than that, you can essentially transform an object into an array with
get_object_vars()