Forum Moderators: coopster
Just upload images/videos as normal upload, and store the path to the file in the database. Have a field for views, rating, etc. Then on the script that displays the image or video, mysql_query() to update the database.
How to go about each step, is there any tutorial for doing do or please suggest some sample code to do the above. My main concern is how to store the path of the file in database and how to retrieve the file. Means first take the id then query the database get the path and then display it?
image_table{
image_id int auto_increment primary key,
image_url text,
image_views int,
date_submitted date,
image_catergory int,
etc...
}
rating_table{
image_id int,
rate_value int,
user varchar(50),
...
}
for uploading and storing files, you will wnt to play with $_FILES, is_uploaded_file(), move_uploaded_file().
[us.php.net...]
[us.php.net...]
dont forget to check for file type!
>> Means first take the id then query the database get the path and then display it?
pretty much
you need to decide before hand how and where you are going to store the file, then it is just a matter of getting the filename and the path will already be known