You are probably looking to write:
$titles = array();
$query = mysql_query("SELECT * FROM ".$prefix."_stories ORDER BY time DESC LIMIT 0,6");
while ($row2 = mysql_fetch_array($query)) {
$titles[] = $row2['title'];
}
echo $titles[3];
In your original code, $titles[$row2['title']]; was a no-op: it simply did nothing but try and access an element of an empty array.