A guy made a script for my site, Im trying to integrate it and make it more like my current site code though, he used a more object oriented approach I think, here is his code below
$bs = $d->rows("select * from `bookmark` where `user`='$_SESSION[auto_id]' order by `position`");
$arr = array();
foreach($bs as $b) $arr[] = " {'id': '$b[id]', 'name': '$b[name]', 'url': '$b[url]'}";
$bs_arr = implode(',', $arr);
how can I make it use something like below instead ?
$sql="select * from `bookmark` where `user`='$_SESSION[auto_id]' order by `position`";
$bs=executequery($sql);
while ($row=mysql_fetch_row($result)){
}
$arr = array();
foreach($bs as $b) $arr[] = " {'id': '$b[id]', 'name': '$b[name]', 'url': '$b[url]'}";
$bs_arr = implode(',', $arr);