Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PHP connections file comments ignored

Explorer ,
Oct 13, 2008 Oct 13, 2008

Copy link to clipboard

Copied

I am trying to use the same connection file for local and remote application access to MySQL db. I try to comment out the settings I don't want to use; the server and user names are different between the remote and local sites. But CS3 seems to ignore the fact that some code is commented - if I look at the settings for a db in the panel, it shows whichever group of settings are set first. Here's an example:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"

# set for localhost
#$hostname_example_conn = "localhost";
#$username_example_conn = "local user name";
#$password_example_conn = "local password";

# set for remote
$hostname_example_conn = "remoteserver.secureserver.net";
$username_example_conn = "remote user name";
$password_example_conn = "remote password";

$database_example_conn = "exampleDB";

$example_conn_dc = mysql_pconnect($hostname_example_conn_dc, $username_example_conn_dc, $password_example_conn_dc) or trigger_error(mysql_error(),E_USER_ERROR);
?>

The commented code shows up as such (i.e., orange) in code view, but if I double click the db in the CS3 panel, it will show the settings for the localhost entry, not the remote ones as I'd expect. If I upload this to the remote server, it seems to work.

Am I missing something here?
TOPICS
Server side applications

Views

314
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2008 Oct 13, 2008

Copy link to clipboard

Copied

antares5 wrote:
> The commented code shows up as such (i.e., orange) in code view, but if I
> double click the db in the CS3 panel, it will show the settings for the
> localhost entry, not the remote ones as I'd expect. If I upload this to the
> remote server, it seems to work.

I haven't tested that myself, but if that's happening, it's a bug. You
should report it here:

http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

The normal way to handle this situation is to create different versions
of the connection file. Upload the remote one to your remote server.
Then create the local one.

The ability for Dreamweaver to support different settings for local and
remote connection files is something that has been frequently requested.
Unfortunately, it hasn't been implemented yet.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 13, 2008 Oct 13, 2008

Copy link to clipboard

Copied

actually, the way it seems to be working allows for a creative solution; running a local testing server ignores the commented code, whereas commercial PHP servers don't, so if one puts the commented code for the localserver first, CS3 uses that info and ignores uncommented settings for the remote server that follow. Conversely, the remote server ignores the commented settings for the local server and uses the remote settings. So the same file works unchanged. Haven't tested this yet, and it's not pretty, but interesting...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2008 Oct 13, 2008

Copy link to clipboard

Copied

antares5 wrote:
> actually, the way it seems to be working allows for a creative solution;
> running a local testing server ignores the commented code, whereas commercial
> PHP servers don't, so if one puts the commented code for the localserver first,
> CS3 uses that info and ignores uncommented settings for the remote server that
> follow.

That might work inside Dreamweaver, but it shouldn't work when you load
the site into a browser in your local test environment. Lines that are
commented out will be ignored by any server.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 13, 2008 Oct 13, 2008

Copy link to clipboard

Copied

LATEST
Of course, you are correct. And I tried it just to verify - once DW kicks off a browser, it fails. So just a plain old bug with no redeeming value...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines