Jump to content

[PHP][SQL] Website playlist system

I've put this off for far too long..

 

I wish to build a playlist system that serves videos to the user. The videos are stored in database currently, consisting of youtube embeds and a few self hosted videos. Originally I was just going to have a few set playlists where I can set the playlist and the video index for the playlist in the database itself, but then I decided to add a search feature, giving users the ability to make custom playlists.
 

I need some opinions on the best way to do this. A dedicated playlist database? A session controlled solution where it looks through the session array? I have a few ideas already, but I wanted to know other people's opinions and ideas?

 

This is my current DB structure where plindex is what I mentioned above, a default play list index for the video. Type is a tag system for the videos for searching. List is the default playlist it belongs to. The others are self explanatory, `code` doesn't matter so much

CREATE TABLE IF NOT EXISTS `table` (  `id` int(11) NOT NULL AUTO_INCREMENT,  `embed` text NOT NULL,  `title` text NOT NULL,  `ytlink` text NOT NULL,  `date` date NOT NULL,  `type` text NOT NULL,  `list` text NOT NULL,  `plindex` int(11) NOT NULL,  `code` int(11) NOT NULL,  PRIMARY KEY (`id`))

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
https://linustechtips.com/topic/265878-phpsql-website-playlist-system/
Share on other sites

Link to post
Share on other sites

personally i would use a seperate playlist table that contains playlist name and playlist id. then a video will belong to a playlist and have an order. so your select would be "select <whatever data> from table where playlistid=<id> order by playlistindex asc

also change table name, dont use just table. make it meaningful.

Link to post
Share on other sites

personally i would use a seperate playlist table that contains playlist name and playlist id. then a video will belong to a playlist and have an order. so your select would be "select <whatever data> from table where playlistid=<id> order by playlistindex asc

also change table name, dont use just table. make it meaningful.

I was thinking of doing this also as a first option, but I've been using databases quite a lot lately for a lot of other sites I've been using and was sorta wanting to move away. But controlling all of this server side is definitely the best way to go about it

 

Oh, and it has a different table name... Just.... Security reasons you know

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to post
Share on other sites

I was thinking of doing this also as a first option, but I've been using databases quite a lot lately for a lot of other sites I've been using and was sorta wanting to move away. But controlling all of this server side is definitely the best way to go about it

 

Oh, and it has a different table name... Just.... Security reasons you know

databases make organizing information pretty easy. you will encounter them for the rest of your life, they are popular

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×