I have 4 variables and I want to grab records from different parts of my database This is what I have $toprev = $row{'title'}; $tofirst = $row{'title'}; $tonext = $row{'title'}; $tolast = $row{'title'}; This is what I need (pseudo code): $toprev = $row{'title'} of prev record; /*so whenever I echo it, it should show the previous record in the db echo "$toprev"; $tofirst = $row{'title'} of first record in the db; /*"" $tonext = $row{'title'} of next record; /*"" $tolast = $row{'title'} of last record in the db; /*"" I know this isn't where you would put the code, it would probably be in the mysql_fetch_array part(I think). I have search to my wits end. Any help would be greatly appreciated!!!
have a sql call to pull the three records you need, then right after you call the select, create a 2-dim array from your recordset, and close the DB connection. Now you can just get your items via index like $rows[0][1]; $rows[1][1]; and $rows[2][1];