How to connect to web database

Post

Posted
Rating:
#1 (In Topic #197)
Regular
bill-lancaster is in the usergroup ‘Regular’
 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
Online now: Yes Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
 Hi Bill,

I have not mastered DB but there is an example in the Gambas Farm called 'DataBaseExample' that might help.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Regular
stevedee is in the usergroup ‘Regular’

bill-lancaster said

…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.
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
bill-lancaster is in the usergroup ‘Regular’
 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.
Online now: Yes Back to the top

Post

Posted
Rating:
#5
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
 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.

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top
1 guest and 0 members have just viewed this.