note 70315 added to function.mysql-connect

From: Date: Wed, 11 Oct 2006 13:51:29 +0000
Subject: note 70315 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-118407@lists.php.net to get a copy of this message
HI! Recently i encountered a strange error, i have a MySQL database server (lets name it: sqlserver.com), but it's different than the server that the page is on (lets name this one: siteserver.com), when i try to connect through PHP to that MySQL database, the operation ends with an error: "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'siteserver.com' (using password: YES) in /home/.../query.php on line 2" So as you can see it states siteserver.com insted of sqlserver.com that is written on the second line of my query.php file. The second line states exactly: "$con = mysql_connect("sqlserver.com","user","pass") or die ('I cannot connect to the database because: ' . mysql_error());" So it suppose to connect to that particular (sqlserver.com)server, and although PHP still tries to connect to the MySQL server that is on the server that tha page is on (siteserver.com). Can anyone tell me why it is happening? And how to make it work? ---- Server IP: 195.136.184.34 Probable Submitter: 83.30.68.126 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- https://master.php.net/note/edit/70315 Del: integrated -- https://master.php.net/note/delete/70315/integrated Del: useless -- https://master.php.net/note/delete/70315/useless Del: bad code -- https://master.php.net/note/delete/70315/bad+code Del: spam -- https://master.php.net/note/delete/70315/spam Del: non-english -- https://master.php.net/note/delete/70315/non-english Del: in docs -- https://master.php.net/note/delete/70315/in+docs Del: other reasons-- https://master.php.net/note/delete/70315 Reject -- https://master.php.net/note/reject/70315 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#118407) next »