Re: mysql_error function

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

 



Niel Archer wrote:
> Hi
>
>> OK, so there is no way how to get error message about mysql_connect()
>> function when establishing more connections?
>
> mysql_error *should* hold the error string from the last used mysql
> function (excepting itself and mysql_errno), that includes the
> mysql_connect() function as it's a mysql function.
>
>> The strange thing is, that it works fine if You use just one
>> connection. In this case, mysql_error() function can takes error
>> message from the mysql_connect() function...
>
>  However, if you don't supply a resource idintifier it will asume the
> last opened link, hence your problem on the second connection
> failure.  When using more than one link, you should specify the link
> resource for mysql_error(), which is difficult for the
> mysql_connect() function, obviously.  I'm not sure if using the
> returned FALSE value would work,
> as I've never had a problem with additional connections.
>

YES, this is the problem.
Since
$dblink2 = mysql_connect(........) is getting false (so no resource object),
so $dblink is not correct parameter for mysql_error() function and it works
same way as there is no parameter.

OK, so mysql_error is not usable for me in this case.
Is in PHP any other way how to get error-message from connect function?
Isn't in PHP any other function, that can be used similiar?

> All of this is clearly decribed on the manual page.
>
> Niel

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux