Re: mysql_connect noob question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Glob Design Info wrote:

> Sorry. The error displayed is:
> 
> *Warning*: mysql_connect() [function.mysql-connect
> <http://localhost/wservices/function.mysql-connect>]: Access denied for
> user '<user>'@'ip70-162-142-180.ph.ph.cox.net' (using password: YES) in
> */Library/WebServer/Documents/wservices/connect.php* on line *29*
> 
> (But with the real user name, not just '<user>')
> 
> Thanks,
> 
> On 4/19/13 3:28 PM, tamouse mailing lists wrote:
>> On Fri, Apr 19, 2013 at 3:43 PM, Glob Design Info <info@xxxxxxxxxxxxxx>
>> wrote:
>>> I know this has probably been answered already.
>>>
>>> When I pass a user name and password from a form to my PHP script and
>>> then pass those to mysql_connect it doesn't connect. When I paste those
>>> exact same values into mysql_connect as string literals it works.
>>>
>>> Can anyone tell me why this happens?
>>>
>>> I know the strings are identical to the literals I try in a test but
>>> they don't work when submitted via form.
>>>
>>> $form_user = $_POST[ 'user' ];
>>> $form_pass = $_POST[ 'password' ];
>>>
>>> # Connect to remote DB
>>>
>>> $LINK = mysql_connect( $host, $form_user, $form_pass );
>>
>> Please show the error you are getting from the mysql_connect
>>
>>
>>> And yes, my $host param is correct.
>>>
>>> Thanks,
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>

First guess is that you don't have privileges for 
'<user>'@'ip70-162-142-180.ph.ph.cox.net', but you may have privileges for 
'<user>'.

And, what are you using for the $host value? If the script and mysql are on 
the same server, it shouldn't need to be anything other than 'localhost'.
-- 
Cheers
David Robley

A man's best friend is his dogma.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux