close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Testing Server and Hosting Server Syncronization

Thread began 11/18/2009 2:22 pm by koneill385535 | Last modified 11/18/2009 3:03 pm by neilo | 1181 views | 4 replies |

koneill385535

Testing Server and Hosting Server Syncronization

Hi,

I am trying to sync my testing server and my hosting server so that I don't have to change the connections file everytime I upload my site. How do I change the hostname on my testing server? Isn't it automatically localhost?

Sign in to reply to this post

CraigRBeta Tester

You hosting server should provide you with the ip address and password of your hosted database.

so, if your local connections file, connectionname.php looks something like this...

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connectionname = "localhost";
$database_connectionname = "NAME";
$username_connectionname = "root";
$password_connectionname = "PASSWORD";
$connectionname = mysql_pconnect($hostname_connectionname, $username_connectionname, $password_connectionname) or trigger_error(mysql_error(),E_USER_ERROR);
?>

create a duplicate file called (for example) connectionname_live.php and put the correct info in.

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connectionname = "0.0.0.0";
$database_connectionname = "databasename";
$username_connectionname = "connectionname";
$password_connectionname = "password";
$connectionname = mysql_pconnect($hostname_connectionname , $username_connectionname , $password_connectionname ) or trigger_error(mysql_error(),E_USER_ERROR);
?>

publish this file to the remote, hosting server, than rename it

Sign in to reply to this post

koneill385535

Uh oh

I tried doing what you said and I must have done something wrong. I had some errors and I tried to fix them, but what I ended up doing screwed up both my connections files. I would tell you what the issue is, but I don't really know. I think I need to open a support ticket.

Sign in to reply to this post

neilo

The likelihood is that 'localhost' would be the hostname.

Have to admit that I'm not sure why people choose to test database locally; unless you are in a wi-fi dead-zone.

I set only one connection per site with hostnames as 'www.mysitenames.co.uk' and the db, username, password as you have them. Set my hosted databases to accept my referral.

Set and forget!

Sign in to reply to this post

neilo

Sorry, apart from the first line, my last post was irrelevant.

Just to be clear, have you tried:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connectionname = "localhost";
$database_connectionname = "Any Connection Name";
$username_connectionname = "YourDB_Username";
$password_connectionname = "YourDB_Password";
$connectionname = mysql_pconnect($hostname_connectionname, $username_connectionname, $password_connectionname) or trigger_error(mysql_error(),E_USER_ERROR);
?>



With the right Username and Password for your (live) database, this would normally do it.

The "Any Connection Name" would need to be the same as the one you've referred to in your pages (if you have already created dynamic content!)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...