Jump to content

Need a push start


divinedesigns1
 Share

Recommended Posts

hey guys, normally ill start pretty much anywhere, but now i need to make a website or app, where when someone logs in and post a video or w.e everyone is able to see it and can also comment on it. my problem is how can i make certain comments display on certain video, image, topic, etc. like if i have a picture and someone placed a comment on the picture, then i have another picture without any comment.how can i keep the comment displayed on the first picture and keep the second picture without any comments until someone make a comment on the second picture ahhh i think i explained that well scratch here this is type confusing sigh i guess i need more knowledge to under take this one :) but trying never hurts right

Link to comment
Share on other sites

start with making the database... make a table for video/image. they will have a unique id, file location, description etc make another table for comments where you will store timestamp of the comment, comment content,and image/cideo id which will be reference of id of image/video in that table, and user name field if it is open for all or a user id pointed to id of user table(Foreign keys). if your comment is for open to all without any authorisation you will not need to track user data, otherwse you will need a user table too to store user information.

Link to comment
Share on other sites

Just to go off of what birbal said, this is kinda what your database would look like. Table A: (Storing the video info) Fields: ID, Name, StorageLink, timestamp, user, ... --------------------------------------------------------------------- Table B: (Storing the Comments) Fields: ID, id_fk, username, comment, timestamp, ... ---------------------------------------------------------------------Next thing you'd have to do then is whenever a user comments on a video, you would set id_fk to the id of the video. Now when you are wanting to receive the comments for a specific video all you have to do is set the id of the video from table a to say $id, then search table b for all entries where id_fk = $id. Then you will only receive the comments for a specific video.

Link to comment
Share on other sites

thanks, but i actually started a little different, if it doesnt work ill try it your way, i still dont understand it tho but oo well better trying than just sitting around

Link to comment
Share on other sites

Mind me asking how you did it?
so far, what i did was create a user table, news table, and a comment table i write all the scripts to make sure those 3 tables are working and the application for each works, so at the moment, you can create news and it will display, you can register and login, the comments i havent check as yet, dont have the time to check to see if its working correct without any errors
Link to comment
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
 Share

×
×
  • Create New...