Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    118
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Mobile app accessing 1&1 MySQL db

    Hi there,

    I'm running a MySQL database on a 1&1 shared server account.
    I'm developing a mobile app that needs to be able to read from and update the database.

    As far as I'm aware, 1&1 does not allow non-local communication with their databases.

    Now I'm sure there should be some way I can work around this using a server side script that can act as the middle man between the app and the database but absolutely no idea where to start.

    Does anyone have any ideas?

    Thanks

    YD

  • #2
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    sure. what you need is script sitting between ckient and database server

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,121
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    Nobody in their right mind would even try to communicate directly from a mobile app (or any client side app) directly with a database. To do so, you would have to pass the DB username and password--along with *ALL* the SQL queries--from the mobile device to the DB server. And that means that anybody who managed to sniff the communications or read the coding of your app would now have full access to your database and could do all sorts of nasties to it. *CLEARLY* you want and need to have server side code that protects you from this kind of stuff. The server-side code knows what kind of requests it will accept from the app and will reject anything else. And it would then never just take a SQL command from the app and execute it, as is. It would always validate and "sanitize" the requests.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Regular Coder
    Join Date
    Jul 2011
    Posts
    118
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    you want and need to have server side code that protects you from this kind of stuff. The server-side code knows what kind of requests it will accept from the app and will reject anything else. And it would then never just take a SQL command from the app and execute it, as is. It would always validate and "sanitize" the requests.
    So would I have my app access a php script using a URL loaded with $_GET vars to define the action required and to authenticate the source? I can understand doing something along those lines.

    What I'm not too sure about is the reading half though.

    How can my app retrieve information from the server? Once my php script authenticates and gets the database info that's been requested, how can I provide this to my app?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •