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

Password is not excepted unless..

New Here ,
Dec 21, 2010 Dec 21, 2010

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

TOPICS
Server side applications

Views

407
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 ,
Dec 22, 2010 Dec 22, 2010

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.

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
New Here ,
Dec 22, 2010 Dec 22, 2010

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

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 ,
Dec 23, 2010 Dec 23, 2010

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.

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
New Here ,
Dec 23, 2010 Dec 23, 2010

Copy link to clipboard

Copied

LATEST

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

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