connect to publicly avaiable database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stribor
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 10:48 pm

connect to publicly avaiable database

Post by stribor »

There is gov web site that is publicly available http://webprod.hc-sc.gc.ca/dpd-bdpp/index-eng.jsp
Here anyone can go and type Drug Identification Number (DIN) and the site will return lots of information about particular drug.
I would like for example to develop web application that would connect to this same database and query it for particular drug.
Since I would need host name,database name,user name,password to connect to this same database how would i do this.
Other example is canada 411 http://www.canada411.ca/. I would like to have custom php application to connect to canada 411 database.
Is this actually possible to do?
Any info would be great
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: connect to publicly avaiable database

Post by twinedev »

Connecting to a database, and connecting to a site and submit information and get the results back are two different things.

I didn't check the second site, but since the first site clearly stats you need written permission to basically use it for what they are letting you use it for on their site, I would recommend you check with them first, as they would tell you 1. if you can legally, 2. if they provide an API that lets you have an app communicate directly with their system.

-Greg
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: connect to publicly avaiable database

Post by califdon »

I agree with twinedev, and further suggest that no administrator in his right mind would ever consider allowing some random requester to gain access to his database, even if the hosting server were to permit it, which is unlikely in the first place.

Aside from the legalities, it is possible to "scrape" data from a website, including data that is derived from a database, but this is a very long and tedious process and I would guess that anyone who has to even ask the question would be incapable of accomplishing this in a finite period of time.
stribor
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 10:48 pm

Re: connect to publicly avaiable database

Post by stribor »

Hi Twindev,
Connecting to web site could also work for me if I have idea on how to do it. So far what I have done is connecting to databases directly.
Would you show me example on how that is done or some tutorial on how to to do this.
Any input would be appreciated.
Post Reply