DataDoIt
|
Posted: 02/25/2004, 7:34 PM |
|
CCS2; PHP4; MySQL
Does anyone know of a slick, quick n' dirty way to use a local database
versus a remote database without having to make (preferably any) changes
within CodeCharge pages themselves? Perhaps some sort of common template
change that could change the data connection based on a condition (url,
login, etc.).
I find it frustrating that I can't test my work in full browser mode on a
local database, or am I missing something?
Thanks.
-Mike
|
|
|
RonB
Posts: 228
|
Posted: 02/26/2004, 2:02 AM |
|
I develop localy and the publish to remote. The database I use localy is an exact copy of the remote database. If i make changes to tha database structure I first update the remote database with the apropriate info and then publish the files.
This does however mean you will have to setup a database server and the programming language of your choice on your local machine.
|
|
|
Daniel Gaudreault
|
Posted: 02/26/2004, 5:57 AM |
|
We do it here using HOSTS files.
For example, in the code we reference database.somewhere.com
(192.168.XXX.2) on our local machines pointing to our dev server.
Then on the production servers we have an entry in the HOSTS file for
database.somewhere.com(192.168.XXX.25). That way codecharge sees no
difference between the targets at that point, you can spoof the ODBC
drivers that way and have a totally homogeneous address for you work.
This trick works under both windows and *nix.
windows: c:\winnt\system32\drivers\etc\hosts
*nix (ususally):/etc/hosts
The caviat however, you must keep your database structures identical.
Best of luck,
Dan
DataDoIt wrote:
> CCS2; PHP4; MySQL
>
> Does anyone know of a slick, quick n' dirty way to use a local database
> versus a remote database without having to make (preferably any) changes
> within CodeCharge pages themselves? Perhaps some sort of common template
> change that could change the data connection based on a condition (url,
> login, etc.).
>
> I find it frustrating that I can't test my work in full browser mode on a
> local database, or am I missing something?
>
> Thanks.
>
> -Mike
>
>
>
|
|
|
DataDoIt
|
Posted: 02/26/2004, 7:54 PM |
|
Perfect suggestion! Thanks.
-Mike
"Daniel Gaudreault" <danielg@cadlink.com> wrote in message
news:c1ktvd$sht$1@news.codecharge.com...
> We do it here using HOSTS files.
>
> For example, in the code we reference database.somewhere.com
> (192.168.XXX.2) on our local machines pointing to our dev server.
>
> Then on the production servers we have an entry in the HOSTS file for
> database.somewhere.com(192.168.XXX.25). That way codecharge sees no
> difference between the targets at that point, you can spoof the ODBC
> drivers that way and have a totally homogeneous address for you work.
>
> This trick works under both windows and *nix.
>
> windows: c:\winnt\system32\drivers\etc\hosts
> *nix (ususally):/etc/hosts
>
> The caviat however, you must keep your database structures identical.
>
> Best of luck,
> Dan
>
>
> DataDoIt wrote:
> > CCS2; PHP4; MySQL
> >
> > Does anyone know of a slick, quick n' dirty way to use a local database
> > versus a remote database without having to make (preferably any) changes
> > within CodeCharge pages themselves? Perhaps some sort of common
template
> > change that could change the data connection based on a condition (url,
> > login, etc.).
> >
> > I find it frustrating that I can't test my work in full browser mode on
a
> > local database, or am I missing something?
> >
> > Thanks.
> >
> > -Mike
> >
> >
> >
|
|
|
|