- Impact
- 19
hey
i am reading a tutorial and it doesnt explain so well..but so far i get almost everything..except for this line..can anyone help me out? heres the entire function:
so it creates an array called $pms..then selects all the enteries from the messages table where the field "to" = "$uid"
but then..here is where i get confused..the entire while array..specially when its filling up the $pms array..can anyone explain it to me?
i am reading a tutorial and it doesnt explain so well..but so far i get almost everything..except for this line..can anyone help me out? heres the entire function:
PHP:
function listpms($uid)
{
$pms = array();
$query = mysql_query("SELECT * FROM `messages` WHERE `to` = '$uid' ORDER BY `time` DESC");
while($r = mysql_fetch_assoc($query))
{
$pms[$r['id']] = array('id' => $r['id'], 'to' => $uid, 'from' => $r['from'], 'title' => $r['title'], 'message' => $r['message']);
}
return $pms;
}
so it creates an array called $pms..then selects all the enteries from the messages table where the field "to" = "$uid"
but then..here is where i get confused..the entire while array..specially when its filling up the $pms array..can anyone explain it to me?









