everlifefree Posted January 10, 2008 Share Posted January 10, 2008 Ok I know how to make it count all the posts but I can't figure out how to make it count the number of posted videos by user. The user id that posted it is stored in the database on each video query. Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/ Share on other sites More sharing options...
Ken2k7 Posted January 10, 2008 Share Posted January 10, 2008 How are you storing the videos? They're in the database? Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435277 Share on other sites More sharing options...
priti Posted January 10, 2008 Share Posted January 10, 2008 are you storing videos details in separate table.?? Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435279 Share on other sites More sharing options...
mrdamien Posted January 10, 2008 Share Posted January 10, 2008 SELECT count(PostID) AS NumberOfPosts, Type, UserID WHERE ((UserID = 4) AND (Type = 'Video')) GROUP BY count(PostID) Â For a fictional database. Â Counts the number of video-posts by user Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435287 Share on other sites More sharing options...
everlifefree Posted January 10, 2008 Author Share Posted January 10, 2008 This is a copy of the database the user id is stored in user... and the location database is: [x]video  Field Type Collation Attributes Null Default Extra Action  id int(11) No auto_increment        videoid varchar(250) latin1_swedish_ci No         date int(64) No 0         category varchar(250) latin1_swedish_ci No         title varchar(250) latin1_swedish_ci No         description longtext latin1_swedish_ci No         tags longtext latin1_swedish_ci No         user int(10) No 0         username varchar(250) latin1_swedish_ci No         rating longtext latin1_swedish_ci No         rating_hits int(10) No 0         rating_avg int(10) No 0         views int(10) No 0         processed tinyint(1) No 1         isbroken int(32) Yes 0        Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435313 Share on other sites More sharing options...
Ken2k7 Posted January 10, 2008 Share Posted January 10, 2008 I'm guessing videoid represents the video right? Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435332 Share on other sites More sharing options...
priti Posted January 10, 2008 Share Posted January 10, 2008 how to you differentiate among your post that it is video post,its text or its an image.Any field in db which store the Type of the uploaded file?? Â what cateogry stores? Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435333 Share on other sites More sharing options...
everlifefree Posted January 10, 2008 Author Share Posted January 10, 2008 this whole database is only video posts Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435336 Share on other sites More sharing options...
Ken2k7 Posted January 10, 2008 Share Posted January 10, 2008 Okay, so you just select the videoid field (just one I recommend) where videoid doesn't equal "" (empty string). Then just mysql_num_rows() on that. Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435339 Share on other sites More sharing options...
everlifefree Posted January 10, 2008 Author Share Posted January 10, 2008 Ok, just one last request would anyone be nice enough to actual post the coding for me. Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435347 Share on other sites More sharing options...
everlifefree Posted January 10, 2008 Author Share Posted January 10, 2008 anyone?? Quote Link to comment https://forums.phpfreaks.com/topic/85309-solved-counting-posts/#findComment-435681 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.