homepage Welcome to WebmasterWorld Guest from 54.196.199.117
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
remote database question
use local db with dreamweaver so what next?
delboy1978uk




msg:1580894
 12:48 am on May 12, 2006 (gmt 0)

hi folks,

i have been mucking about on mysql on my home pc with dreamweaver using php

now i have bought hosting with a mysql database

questions:

1. when i set up the site in dreamweaver, do i use the local database or do i connect to the remote database?

2. the remote db is empty, how can i transfer tables over?

cheers :-)
del

[edited by: jatar_k at 5:48 pm (utc) on May 12, 2006]
[edit reason] no specific hosts thanks [/edit]

 

wheelie34




msg:1580895
 8:35 am on May 12, 2006 (gmt 0)

try to just dump the local db (structure and data) to a .sql file then in phpmyadmin go to the db and either (if its a small file) copy n paste it into the sql command window, or below that browse for the file and upload, should work.

delboy1978uk




msg:1580896
 5:44 pm on May 12, 2006 (gmt 0)

yeah cheers but will the code for my pages still point to my local database? i want my local database to be used for testing on apache on my machine, then upload it to the remote site using the remote database

jatar_k




msg:1580897
 5:50 pm on May 12, 2006 (gmt 0)

take a look at your connection functions

mysql_connect

it should have the host in there, I am guessing it is set as localhost, if that is the case then you just need to look at your hosting and see if that setting is the same. If it is then you don't need to worry, it will work on both.

If there is a different setting you need to use on your host then you could use a config file on each that has the appropriate connection settings.

storevalley




msg:1580898
 5:53 pm on May 12, 2006 (gmt 0)

yeah cheers but will the code for my pages still point to my local database? i want my local database to be used for testing on apache on my machine, then upload it to the remote site using the remote database

Isolate the part of your script that connects to your db in a separate file. Have a copy on your server that connects to your remote db and a local copy that connects to your local db (just cloak this file in Dreamweaver so that it is ignored when you synch).

<edit>jatar_k beat me to it :)</edit>

delboy1978uk




msg:1580899
 9:54 pm on May 14, 2006 (gmt 0)

cheers for the info, so if the hosting server's mysql setup is set to localhost then they should both (local and remote) use their own databases?

obviously if not then the including the code from a seperate file would be a good idea, but i use dreamweaver to make the connection and design the pages, so how do you separate the connection code?

storevalley




msg:1580900
 1:13 pm on May 15, 2006 (gmt 0)

if the hosting server's mysql setup is set to localhost then they should both (local and remote) use their own databases?

Yes ... "localhost" will refer to the machine on which your script is running.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved