1337hovie Posted February 3, 2010 Share Posted February 3, 2010 i have a db. edit record page. display record page. on edit record page i need to have a drop down (tier1,tier2,tier3) once its selected and updated to table. on DISPLAY page, i need to drop it into the correct box according to the drop down tier. edit page looks like this form: tier: *dropdown* name: *text field* etc: *textfield* dbtable looks like: id,tier,name, etc, etc display page: ---------------tier1----------- slot1 slot2 slot3 ..... ---------------tier2--------- slot1 slot2 slot3 ..... --------------tier3------- slot1 slot2 slot3 i need it so once they choose the tier, it'll add it to that table on the display page. do i need seperate tables? and once its updated, it'll post to correct db table? then just display the tier1 table, tier2 table, tier 3 table? what if i change the tier on the record? will it remove it from 3 and move it to 2, or 1? Thanks! Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/ Share on other sites More sharing options...
aeroswat Posted February 3, 2010 Share Posted February 3, 2010 I am so lost at what you are trying to accomplish Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/#findComment-1006185 Share on other sites More sharing options...
1337hovie Posted February 3, 2010 Author Share Posted February 3, 2010 i have a database table like this: tier1, joey, etc, etc tier3, sal, etc, etc tier2, stew, etc, etc tier1, john, etc ,etc i have a drop down selecting which tier they're in. and it updates that tier to that db row. i need to have a display page, depending on what tier they are, sort the records by tier and put them into that table. think a very basic HTML page, with 3 tables - one at the top, one in middle, one at the bottom. all tier 1's ----------- slot slot slot all tier 2's-------- slot slot slot all tier 3's---- slot slot slot so whatever tier they are in, according to that database column, will drop them into the correct table on that display page. its a little confusing. I just dont know if i need to make seperate tables for each tier? and the drop down will choose the proper db table to put it into? and on the display page just have tables outputting the 3 diff tier tables? Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/#findComment-1006205 Share on other sites More sharing options...
aeroswat Posted February 3, 2010 Share Posted February 3, 2010 You would use 3 different mysql queries. SELECT * FROM table WHERE tier='tier1' SELECT * FROM table WHERE tier='tier2' etc or you can loop with a for loop going from 1 to 3 and do the queries that way. Of course to traverse each query you would put a while loop inside of that for loop. This would be your pseudo-code. for(1 to 3){ result=querydb(tier1) print tier while(get rows from result) { print name } } if you need help with the actual code let me know Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/#findComment-1006234 Share on other sites More sharing options...
jaz529 Posted February 6, 2010 Share Posted February 6, 2010 this is the content.module which calls all the pages so what should i change and a make slideshow.module whi calls slide show. <?php global $rootpath,$sitepath; $site_template = getSetting("sitetemplate",$db); $filepath = $rootpath.'templates/'.$site_template.'/'.$c_file; if (file_exists($filepath) || isset($c_content)) { if(isset($c_content)){ $c_content='?'.'>'.trim($c_content).'<'.'?'; eval($c_content); }else{ include($filepath); } } ?> THIS IS WHAT IS THERE IN CONTENT.INC WHICH IS CALLED BY CONTENT.MODULE. $accountManagementPage=false; if (($_GET['id']=='56')&&(getSetting("accountpageon",$db)==0)) { $_GET['id']='1'; } if($_GET['id'] >= 200){ $db->query("SELECT * FROM content WHERE linkid = ".quote_smart($_GET['id'])); $res = $db->fetch(); $c_content = $res['page']; $c_header = $res['title']; $c_file = ""; }else{ switch($_GET['id']) { //Accessible to all case '1': $c_file = 'modules/latest.module'; $c_header = 'Home'; break; case '2': $c_file = 'modules/toprated.module'; $c_header = 'Top Rated <strong>Media</strong>'; break; case '3': $c_file = 'modules/mostviewed.module'; $c_header = 'Most Viewed <strong>Media</strong>'; break; case '4': $c_file = 'modules/forgot.module'; $c_header = 'Forgotten Login'; break; case '5': $c_file = 'modules/upload.module'; $c_header = 'Upload Media'; break; case '6': $c_file = 'modules/register.module'; $c_header = 'Register'; break; case '8': $c_file = 'modules/play.module'; $c_header = dec_VID; break; case '10': $c_file = 'modules/activate.module'; $c_header = 'Activate Your Account'; break; case '11': $c_file = 'modules/tellafriend.module'; $c_header = 'Tell a Friend'; break; case '88': $c_file = 'modules/members.module'; $c_header = 'Members'; break; case '16': $c_file = 'modules/terms.module'; $c_header = 'Terms of Service'; break; case '18': $c_file = 'modules/profile.module'; $c_header = 'Profile'; break; case '19': $c_file = 'modules/groups.module'; $c_header = 'Groups'; break; case '20': $c_file = 'modules/showgroup.module'; $c_header = 'View Group'; break; case '21': $c_file = 'modules/category.module'; $c_header = 'Category'; break; case '22': $c_file = 'modules/mediasearch.module'; $c_header = 'Search'; break; case '23': $c_file = 'modules/showimage.module'; $c_header = 'Display Image'; break; case '24': $c_file = 'modules/alltags.module'; $c_header = 'Tags'; break; case '25': $c_file = 'modules/add.module'; $c_header = 'Add'; break; case '26': $c_file = 'modules/out.module'; $c_header = 'Out'; break; case '27': $c_file = 'modules/showallfriends.module'; $c_header = 'All My Friends'; break; case '28': $c_file = 'modules/domedia.module'; $c_header = 'Change Media Ad'; break; case '29': $c_file = 'modules/rss.module'; $c_header = 'Rss Feeds'; break; case '30': $c_file = 'modules/news.module'; $c_header = 'Sites News'; break; case '31': $c_file = 'modules/edit.module'; $c_header = 'Edit My Media'; break; //User only pages case '55': $c_file = 'modules/usercp.module'; $c_header = 'Control Panel'; break; case '56': $c_file = 'modules/account.module'; $c_header = 'Account Management'; $accountManagementPage=true; break; //Admin only pages case '100': $c_file = 'modules/admin/index.module'; $c_header = 'Administration'; break; case '101': $c_file = 'modules/admin/add_cat.module'; $c_header = 'Add Category'; break; case '102': $c_file = 'modules/admin/show_cats.module'; $c_header = 'Category Overview'; break; case '103': $c_file = 'modules/admin/show_media.module'; $c_header = 'Media Overview'; break; case '104': $c_file = 'modules/admin/new_uploads.module'; $c_header = 'New Uploads'; break; case '105': $c_file = 'modules/admin/users.module'; $c_header = 'Registered Users'; break; case '106': $c_file = 'modules/admin/settings.module'; $c_header = 'Settings'; break; case '107': $c_file = 'modules/admin/play.module'; $c_header = 'Preview Media'; break; case '108': $c_file = 'modules/admin/contentmanager.module'; $c_header = 'Content Management'; break; case '109': $c_file = 'modules/admin/menumanager.module'; $c_header = 'Menu Management'; break; case '111': $c_file = 'modules/admin/emailmanager.module'; $c_header = 'Email Management'; break; case '112': $c_file = 'modules/admin/import.module'; $c_header = 'Import Media'; break; case '113': $c_file = 'modules/admin/badwords.module'; $c_header = 'Bad Words'; break; case '114': $c_file = 'modules/admin/massemail.module'; $c_header = 'Mass Email'; break; case '115': $c_file = 'modules/preview.module'; $c_header = 'Preview Page'; break; case '116': $c_file = 'modules/admin/mediasetting.module'; $c_header = 'Media Settings'; break; case '117': $c_file = 'modules/admin/videoads.module'; $c_header = 'Manage Video Ads'; break; case '118': $c_file = 'modules/admin/adblocks.module'; $c_header = 'Manage Site Ads'; break; case '150': $c_file = 'modules/admin/extras.module'; $c_header = 'Manage Extras and Mods'; break; case '119': $c_file = 'modules/admin/traffic.module'; $c_header = 'Manage Traffic Exchange'; break; case '121': $c_file = 'modules/admin/rewards.module'; $c_header = 'Manage Reward System'; break; case '122': $c_file = 'modules/admin/ignore.module'; $c_header = 'Ajax Functions for Rewards'; break; case '123': $c_file = 'modules/admin/stats.module'; $c_header = 'Admin Stats'; break; default: $c_file = 'modules/error.php'; $c_header = 'Error 404'; break; } } ?> SO COULD YOU PLEASE TELL ME WHAT SHOULD I CHANGE IN THE PROGRAMMING CODE FOR MAKING A SLIDESHOW.MODULE AND SLIDESHOW.IC WHICH CALLS THE SLIDESHOW Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/#findComment-1008015 Share on other sites More sharing options...
jaz529 Posted February 6, 2010 Share Posted February 6, 2010 SORRY WRONG POST Link to comment https://forums.phpfreaks.com/topic/190811-drop-down-sort-help/#findComment-1008019 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.