A post by
@lawsonm1 earlier was talking about how he wanted to be able to store info about video clips in a file or something to be read back later so he can open them in VLC. This is just a test to show that it would work but here is my contribution using MySQL. I'm not posting the whole code here because I would need to use Source Merger and there would be a lot of cutting. I'll just post the main module that does the work :)
'$INCLUDE:'MYSQL.BI'
mydb = DB_Open("Spriggsy", "videouser", "pass@word", "")
Video.video_name = "Superman Returns"
Video.coloration = "color"
Video.clip_length = "2h49m"
Video.clip_type = "movie"
Video.vid_id = AddVideo(Video)
PRINT "Successfully added "; Video.video_name;
" to database"
Video.vid_id = 0
DB_QUERY "INSERT INTO `videos`.`video` (video_name, coloration, clip_length, clip_type) VALUES ('" + Video.video_name + "','" + Video.coloration + "','" + Video.clip_length + "','" + Video.clip_type + "');"
DB_QUERY "SELECT vid_id FROM `videos`.`video` WHERE video_name = '" + Video.video_name + "' AND coloration = '" + Video.coloration + "' AND clip_length = '" + Video.clip_length + "' AND clip_type = '" + Video.clip_type + "';"
ReturnVideo.vid_id
= VAL(DB_RESULT
(1, y
)) IF ReturnVideo.vid_id
<> 0 THEN AddVideo = ReturnVideo.vid_id
AddVideo = 0
'$INCLUDE:'MYSQL.BM'
Here are screenshots showing the program working:
I think it would be a great idea to use MySQL as it doesn't require any kind of parsing of a file or knowing any kind of insane sorting algorithms. I'll end up showing more for this later on when I finally do a post all about how to use MySQL effectively in QB64. This is just a simple usage. I figured using a user defined type would be best so you can keep it straight in your mind the column names and the variables that they pair with.