note 98799 added to function.mysql-connect
| From: | octav at expect dot ro | Date: | Thu, 08 Jul 2010 12:14:36 +0000 |
| Subject: | note 98799 added to function.mysql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170785@lists.php.net to get a copy of this message | ||
This script works most of the time BUT if the password contains $ it doesn't work:
$db_location = "localhost";
$db_username = "username";
$db_password = "pa$sword";
$db_name = "00000001050_a";
$link_id = mysql_connect ($db_location,$db_username,$db_password)
or die ("Could not connect: " . mysql_error());
It took me a while to realize that I have to use ' instead of " for it to work
$db_password = "pa$sword"; didn't work
$db_password = 'pa$sword'; worked
----
Server IP: 69.147.83.197
Probable Submitter: 188.25.9.123
----
Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php
Edit -- https://master.php.net/note/edit/98799
Del: integrated -- https://master.php.net/note/delete/98799/integrated
Del: useless -- https://master.php.net/note/delete/98799/useless
Del: bad code -- https://master.php.net/note/delete/98799/bad+code
Del: spam -- https://master.php.net/note/delete/98799/spam
Del: non-english -- https://master.php.net/note/delete/98799/non-english
Del: in docs -- https://master.php.net/note/delete/98799/in+docs
Del: other reasons-- https://master.php.net/note/delete/98799
Reject -- https://master.php.net/note/reject/98799
Search -- https://master.php.net/manage/user-notes.php