How to connect to web database

Post Reply
bill-lancaster
Posts: 34
Joined: Tuesday 26th September 2017 3:17pm

How to connect to web database

Post by bill-lancaster » Friday 23rd November 2018 5:42pm

My website has a database which I would like to access using Gambas.
It's a mysql db but I can't get the right settings to make a db.connection
Any advice would be appreciated

User avatar
cogier
Site Admin
Posts: 205
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: How to connect to web database

Post by cogier » Saturday 24th November 2018 4:44pm

Hi Bill,

I have not mastered DB but there is an example in the Gambas Farm called 'DataBaseExample' that might help.

stevedee
Posts: 90
Joined: Monday 20th March 2017 6:06pm

Re: How to connect to web database

Post by stevedee » Saturday 24th November 2018 7:49pm

bill-lancaster wrote:
Friday 23rd November 2018 5:42pm
...It's a mysql db but I can't get the right settings to make a db.connection...

Can I see your code? I haven't used mysql either, but I used sqlite3 a few years ago, and it didn't seem too difficult.

bill-lancaster
Posts: 34
Joined: Tuesday 26th September 2017 3:17pm

Re: How to connect to web database

Post by bill-lancaster » Sunday 25th November 2018 9:14am

Thanks for the responses, I've been learning a bit out web based databases. First, it seems that to use mysql commands over the internet is a very insecure thing to do, then I discovered that my web service provider does not allow access the the database anyway! I've been using mysql with local databases for some time now but have never tried to access a remote database.
As to my code, it was just a question of getting the right values for User Name, Login, Port and Password correct but this is the wrong approach to solving my problem. I'm should be able to write code that would run on the website and access my local database.

Post Reply