So, if you pass NULL in as the first parameter to mysql_real_connect, a possibility opened up by the manual, what is the return. If it is "a MYSQL* connection handle if the connection was successful", where did the space for that handle come from.
I agree with Mario - if someone is going to go through the documentation, as recommended on every post, the least that can be expected is that the documentation should be un-ambiguous. Regards Quentin -----Original Message----- From: Sinisa Milivojevic [mailto:[EMAIL PROTECTED]] Sent: Sunday, 25 November 2001 2:20 a.m. To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: API documentation issue : inconsistency in mysql_real_connect documentation M. A. Alves writes: > What is the semantics of passing a NULL mysql connection to > mysql_real_connect()? Does it create a new handler? This is the only > possible interpretation of the result value as documented. However it is > also (abundantly) documented that the handle must be created with > mysql_init(). So what stands? (I transcribe below the relevant part of the > manual. The last sentence of the excerpt is the crux of the problem.) > > This is not a pressing issue, just one of correctness. I find it a bit > surprising that such an inconsistency, or incompletness, still exists in > the documentation of such a very important part of mysql as the only API > means of making connections. > > << > 8.4.3.171 mysql_real_connect() > > . . . > > The first parameter should be the address of an existing MYSQL structure. > Before calling mysql_real_connect() you must call mysql_init() to > initialize the MYSQL structure. > > . . . > > 8.4.3.173 Return Values > > A MYSQL* connection handle if the connection was successful, NULL if the > connection was unsuccessful. For a successful connection, the return value > is the same as the value of the first parameter, unless you pass NULL for > that parameter. > >> > (http://www.mysql.com/documentation/mysql/bychapter/manual_toc.html) > > -- > , > M A R I O data miner, LIACC, room 221 tel 351+226078830, ext 121 > A M A D O Rua Campo Alegre, 823 fax 351+226003654 > A L V E S P-4150-180 PORTO, Portugal mob 351+939354002 > > > Hi! I think that our documentation is quite clear on that issue. First parameter should be a pointer returned by mysql_init, while a return value from mysql_real_connect is used for testing purposes. -- Regards, __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, you are asked to respect that confidentiality and not disclose, copy or make use of its contents. If received in error you are asked to destroy this email and contact the sender immediately. Your assistance is appreciated. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php