Reply to Re: Connecting to local database from Internet

Your name:

Reply:


Posted by Jerry Stuckle on 05/17/07 12:53

mouac01@yahoo.com wrote:
> I'm not sure if this is possible. I would like to have a PHP app on
> the Internet connect and write to a local database (Intranet). For
> example, users would go to a web site http://www.internet.com to run
> the app. The app requires an internet connection and is outside of
> the user's network. The app would have the option to either store
> data locally or on the Internet. I would like to give users the
> option to store data locally because some may have privacy/security
> concerns if the data is stored on the Internet or kept/maintained by
> another company.
>
> Would the connection string below work from the Internet to connect to
> the user's local database? I don't have my web hosting service up yet
> so I can't test. Thanks...
>
> <?php
> $server='localhost' //or whatever the client db server name is
> $c=new mysqli($server,'user','passwd','db');
> ?>
>

As Sabine indicated, php runs on the server, so 'localhost' will always
be the server's database.

In addition, you shouldn't plan to store data in the client's database.
Most people don't have MySQL installed. Most of those who do have it
installed on their local machine either have network connections
disabled or have a firewall which prevents external access. And those
who do allow external access are not likely to give out a
userid/password to another website - at least not if they have any sense
at all. And even if they give you their userid and password, you don't
know if they have the appropriate database and tables - or maybe have
that database and table name for an entirely different use.

I don't know what kind of data you're storing, but I don't think this is
a good way to go.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация