Hello Konstantin,

this code is buggy, because 'new' is not a valid C operator.
And MYSQL is a struct not an object.

The 'new' operator allocates memory for objects (C++).
In C you?ve to use the malloc function.

Take a look at the libmysqltest example, which comes with your distribution.

Regards
Andy


> -----Ursprungliche Nachricht-----
> Von: Konstantin Osipov [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 8. Februar 2001 10:30
> An: [EMAIL PROTECTED]
> Betreff: ó API help
>
>
> Hi All!
>
> Is this code buggy?
> --
> MYSQL* mysql = new MYSQL;
>
> mysql_init(mysql);
>
> mysql_real_connect(mysql, "localhost");
> /* some work*/
> mysql_close(mysql);
> mysql_real_connect(mysql, "otherhost");
> /* some work*/
> mysql_close(mysql);
>
> delete mysql;
> --
> In other words, if struct MYSQL allocated manually, should i call
> mysql_init(mysql) after mysql_close(mysql) if i want to connect using this
> struct to other database?
>
>
> WBW, Konstantin
>
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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

Reply via email to