brown2005 Posted February 14, 2008 Share Posted February 14, 2008 i have two tables tablea tableb when some1 loads the page i want to display a record i want 1. tablea 2. tableb 3. tableb 4. tableb 5. tableb 6. tablea 7. tableb 8. tableb 9. tableb 10. tableb 11. tablea and so on..... any help would be much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/91099-select-1-table-every-5-times/ Share on other sites More sharing options...
Isityou Posted February 14, 2008 Share Posted February 14, 2008 So, will the table be chosen at random? Quote Link to comment https://forums.phpfreaks.com/topic/91099-select-1-table-every-5-times/#findComment-466923 Share on other sites More sharing options...
brown2005 Posted February 14, 2008 Author Share Posted February 14, 2008 the tables will be chosen as above.. when the first person views it. it will select tablea. and when person 2 views it table b.. and so on.. tablea will have 1 record.. and tableb will have numerous records that will be slected at random Quote Link to comment https://forums.phpfreaks.com/topic/91099-select-1-table-every-5-times/#findComment-466927 Share on other sites More sharing options...
Isityou Posted February 14, 2008 Share Posted February 14, 2008 One way you can solve it is create a new database table that is boolean (true/false). Than every time a user views tablea, switch the boolean to false, so the next time another user views it it will display tableb. <?php if(boolean == true) { // display tablea } else { // display tableb } Quote Link to comment https://forums.phpfreaks.com/topic/91099-select-1-table-every-5-times/#findComment-466935 Share on other sites More sharing options...
brown2005 Posted February 14, 2008 Author Share Posted February 14, 2008 thanks for your help. i have never heard of boolean before. how do i do this please? Quote Link to comment https://forums.phpfreaks.com/topic/91099-select-1-table-every-5-times/#findComment-466992 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.