PatRoy Posted March 19, 2020 Share Posted March 19, 2020 Hello folks, So, not sure where to start, but I'm wondering if it's at all possible to change a prepared statement / sql based on whether or not we're displaying for desktops, or for smartphone/tablets? I'm not sure what to start looking at since I'm pretty new in PHP and all... I've managed to figure out how to change CSS if I'm on phone @media only screen and (max-width: 767.98px){ // PUT CSS FOR PHONES... } Any directions on how I would change my SQL, would be awesome! I'd like to narrow down the columns returned if I'm on phone, otherwise breaks my pages looks too much... Much thanks in advance! Pat Quote Link to comment https://forums.phpfreaks.com/topic/310327-change-sql-selects-based-on-if-on-desktop-or-phonetablet/ Share on other sites More sharing options...
requinix Posted March 19, 2020 Share Posted March 19, 2020 From what you're describing it sounds like the problem is the way those columns are displayed. Right? Which would make it a job for CSS. Right? Depending on your CSS framework, you can show and hide things depending on screen sizes... Quote Link to comment https://forums.phpfreaks.com/topic/310327-change-sql-selects-based-on-if-on-desktop-or-phonetablet/#findComment-1575620 Share on other sites More sharing options...
PatRoy Posted March 20, 2020 Author Share Posted March 20, 2020 Arghh stupid me ! Of course... you made me realise all I have to do is assign a css class say "hideme" to my columns TD/TH's I want hidden on phones, and have my stylesheet do something like: @media only screen and (max-width: 767.98px){ .hideme{ display: none; } } Something like that should do it. Thanks for your help again :) Pat Quote Link to comment https://forums.phpfreaks.com/topic/310327-change-sql-selects-based-on-if-on-desktop-or-phonetablet/#findComment-1575636 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.