I have a database of movie titles (id,title) that I want to create into pages. One page per movie title in my database.
The page creation process already works.. But on each page, I wish to create a list that links to the previous 15 and next 15 movie titles.
What I am trying to do is, in the While loop for creating movie title pages, I take the movie title id, say 25.
Then I get make two new values, like this:
$titleid = $row['id'];
$titleidmax = $titleid + 15;
$titleidmin = $titleid - 15;
then I am attempting to
query the server something like this:
$query = "SELECT * FROM $table WHERE id >$titleidmin OR id >0 OR id <$titleidmax LIMIT 30";
$gettitles = mysql_query($query) or die(mysql_error());
i am thinking that $gettitles would have an array of 30 movie titles, the previous 15 and next 15 in it. Then I also added >0 incase the id is in the first 15 and there arent 15 previous titles to pull from...
gah I am probably not making any sense.
But basically this isnt working. Hopefully you get the concept of what I am trying to do and can point me in the write direction or tell me what im doing wrong.
Summary of what im trying to do:
In a array loop, I am trying to select titles within a range, that are not currently in the loop, so that I can add extra links to my pages.