Re: [PHP] using existing mysql connection in a php extension

From: Gareth Williams (gareth_at_venditor.com)
Date: 10/31/03

  • Next message: Spyproductions Support Team: "Handling a BLOB (zip file) called from MySQL"
    Date: Fri, 31 Oct 2003 14:24:24 +0100
    To: php-general@lists.php.net
    
    

    Hi there,

    Try this:

       mysql_pconnect($_host, $_user, $_password) or die("Could not connect:
    " . mysql_error());;

    This open a permanent mysql connection. The first time you run it, it
    opens the connection, and the second time, etc, it just uses the one
    already opened.

    On Friday, Oct 31, 2003, at 13:14 Europe/Amsterdam, Adrian wrote:

    > hello,
    >
    > is it possible to use an existing mysql connection created from
    > php-code $conn=mysql_connect('localhost','root','secret'); in an
    > php-extensions, e.g. by giving the ressource id to the extension as an
    > argument: my_extemsion_function('do_something',$conn); ?
    > because if i have to connect to the mysql server again from my
    > extension, i'll lose the performance-improvement gained from the
    > faster C++-code.
    >
    > --
    > Adrian
    > mailto:adrian@planetcoding.net
    > www: http://www.planetcoding.net
    > www: http://www.webskyline.de
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >


  • Next message: Spyproductions Support Team: "Handling a BLOB (zip file) called from MySQL"

    Relevant Pages

    • Re: Qusnetsoft suddenly unregistered
      ... open the program for the first time, ... If I click yes, the program opens and appears to work except that, as I ... Werner Ruotsalainen - Microsoft MVP - Windows - Mobile Devices. ...
      (microsoft.public.pocketpc)
    • Re: Speeding up Office applications
      ... problem of Outlook "locking up" numerous times. ... >>> opens ... >>>> The reason why the first time it loads slowly and after that it ... Just the first Office app ...
      (microsoft.public.office.misc)
    • Re: Need help resolving modeless dialog issue
      ... I have a modeless dialog I'm launching from a menu. ... Note that by specifying 'this', you make the parent be the current window, so you don't ... and select it again, it opens correctly. ... you only showed the code that handles it for the first time. ...
      (microsoft.public.vc.mfc)
    • Re: SetOption "Default Database Directory"
      ... As I said it works except for the first time the database opens and is set ... even with the rowsource problem solved. ... Database and reopen it and the form, ...
      (microsoft.public.access.formscoding)
    • Re: Speeding up Office applications
      ... Ram laptop with XP. ... I have Outlook pinned to my start menu and it opens ... The reason why the first time it loads slowly and after that it loads fast ... Vista uses "superfetch" to battle its own bloated software, ...
      (microsoft.public.office.misc)