OK, what's wrong with this loop?
Code:
$result=mysql_query("SELECT *, UNIX_TIMESTAMP(time) AS newdate FROM albums WHERE username='$username' ORDER BY time DESC");
$num=mysql_numrows($result);
$thumb = array();
for($i=0;$i<$num;$i++){
$id=mysql_result($result,$i,"id");
$result2=mysql_query("SELECT * FROM images WHERE id='$id' ORDER BY pic_id LIMIT 1");
$thumb[$i]=mysql_result($result2,$i,"thumb");
}
For some reason it only populates index=0 of the array.