Jump to content

Change SQL Selects based on if on desktop or phone/tablet ?


PatRoy

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.