I am developing a video site ( PHP - MYSQL), like youtube, in which I want to provide video Nextand Previousvideo functionality . Suppose I'm on now videoId: 234, so the Next and Previous links of the video will point to videoId: 233and, 235respectively.
My table structure is as follows:
videoId videoName videoURL IsActive
-----------------------------------------------------
1 Love world love-world 1
2 Hello world hellow-world 1
3 World news world-news 0
4 The web the-web 1
5 Google web google-web 1
6 Internet internet 1
IsActive a bool (0,1) type columnbasically says that the video can be viewed on the website or not. If its 0 is inconspicuous and 1 is visible
Now there are two types of situations that I, though:
When I look at videoId: 4, I want to run a query to get the next and previous video IDs, respectively 2 and 5, 3, not because it is disabled.
videoId: 1, , 2, , .
, , ?