Skip to main content
Participant
December 22, 2010
Question

Password is not excepted unless..

  • December 22, 2010
  • 1 reply
  • 448 views

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

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
December 22, 2010

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.

marekk617Author
Participant
December 22, 2010

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

David_Powers
Inspiring
December 23, 2010

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.