noidea Posted August 10, 2013 Share Posted August 10, 2013 Hi I have a list of youtube videos in a flat file database. I would like to print a thumbnail of these videos out to the end user in a table. The results need to have pagination as well as a dynamic table so i can display say 3 rows and 3 columns per page. The column amount will also need to be adjustable in case i wish to change the columns from 3 to 4 for example: $video_file_data[]; //This is the array in which all video info will be stored $start = $_REQUEST['start']; //pagination setting $videos_per_page = 9; //Show 9 Vids per page $table_colums = 3; //Amount of columns needed to display results per page $num = count ($video_file_data); //Number of lines in data array $max_pages = @ceil($num / $videos_per_page); //Maximum number of Pages $cur = @ceil($start / $videos_per_page)+1; for($i=$start;$i<min($num,($start+$videos_per_page)+0);$i++) { list($date_added, $video_title, $youtube_url) = explode('|', trim($video_file_data[$i])); // <--- Table needs to go } The info stored in $video_file_data[] would look something like this: date 1."|".title 1."|".youtube url 1 date 2."|".title 2."|".youtube url 2 date 3."|".title 3."|".youtube url 3 date 4."|".title 4."|".youtube url 4 Many thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/ Share on other sites More sharing options...
trq Posted August 10, 2013 Share Posted August 10, 2013 You forgot to ask a question. Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444306 Share on other sites More sharing options...
noidea Posted August 10, 2013 Author Share Posted August 10, 2013 You forgot to ask a question. DOHH!! so sorry lol The question is i guess, how can this be done.. im really stuck on this cheers Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444307 Share on other sites More sharing options...
trq Posted August 10, 2013 Share Posted August 10, 2013 The logic is no different to pagination using a proper database. Still stuck? Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444308 Share on other sites More sharing options...
noidea Posted August 10, 2013 Author Share Posted August 10, 2013 The logic is no different to pagination using a proper database. Still stuck? i really stuck lol, been tryin to work it out all night lol I just dont even know where to start with the table and how to create the dynamic columns If you could help id be very grateful, oh master lol Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444309 Share on other sites More sharing options...
noidea Posted August 10, 2013 Author Share Posted August 10, 2013 the pagination links ive already got for the code above.. my main problem is getting the results out in the table thanks Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444310 Share on other sites More sharing options...
noidea Posted August 10, 2013 Author Share Posted August 10, 2013 The logic is no different to pagination using a proper database. Still stuck? Sorry but if by "proper database" you mean a SQL database, I have never worked with one so i have no idea about how they work It is something I may look into in the future Quote Link to comment https://forums.phpfreaks.com/topic/281021-dynamic-table-with-pagination-flat-file/#findComment-1444312 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.