Copy link to clipboard
Copied
Hello
I am wondering why all of the sudden I have to change the sumbol " to ' where the password is located in the Connection file, otherwise if I keep it as " I cant connect to the database.
I am not sure if this has to do with my ISP or of this is something that has changed in latest version of MySQL.
Thank you for any assistance
Mark
Copy link to clipboard
Copied
Using single or double quotes should not make any difference. It's not clear if you're talking about the connection file created by Dreamweaver or if it's something you have coded yourself. If it's your own code, it sounds as though you're not escaping quotes correctly before submitting the password to the database.
Copy link to clipboard
Copied
David
this is the file that dreamweaver made, that resides under "Connections" directory.
Basically it looks like this:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_class_db = "localhost";
$database_class_db = "unitedhe_classdata";
$username_class_db = "unitedhe_xxxxxxx";
$password_class_db = 'xxxxxxxxxxx';
$class_db = mysql_pconnect($hostname_class_db, $username_class_db, $password_class_db) or trigger_error(mysql_error(),E_USER_ERROR);
?>
This way it will work but if I have " around the password_class_db then it will not connect.
I called the hosting company and they were the ones to tell me to replace the " with '
Mark
Copy link to clipboard
Copied
marekk617 wrote:
This way it will work but if I have " around the password_class_db then it will not connect.
I called the hosting company and they were the ones to tell me to replace the " with '
I don't expect you to post your password in a public forum; but if changing the double quotes to single quotes solved the problem, your password must contain ". You can't include " in a double-quoted string without escaping it.
This is simple PHP syntax. See the PHP Manual: http://docs.php.net/manual/en/language.types.string.php.
Copy link to clipboard
Copied
David
Thank you for all your help
but I got it figured out
what was happening was the fact that I was using different login name as opposed to the main one, and with that username/password I was not having access to the /www/ (root).
Once I changed that it all started to work correctly.
Thank you for some hints.
Mark