Page 1 of 1

How to connect to web database

Posted: Friday 23rd November 2018 5:42pm
by bill-lancaster
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

Re: How to connect to web database

Posted: Saturday 24th November 2018 4:44pm
by cogier
Hi Bill,

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

Re: How to connect to web database

Posted: Saturday 24th November 2018 7:49pm
by stevedee
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.

Re: How to connect to web database

Posted: Sunday 25th November 2018 9:14am
by bill-lancaster
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.

Re: How to connect to web database

Posted: Friday 21st December 2018 9:32pm
by Got2BeFree
Since I run my own dedicated, off-site server I can open up access to my databases. When I do do this, I make sure it is accessible only to my remote (home) IP address. I know this doesn't help you in your situation, but I just wanted to throw this out there.

Also, make sure any code you use on your website to access your db is secure. Hackers can exploit bad code for SQL injection.