[PHP] Persistent database connections in PHP

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default RE: [PHP] Persistent database connections in PHP

    I haven't heard of persistent connections with MySQL before, and I think
    is because PHP can't handle it. PHP will connect to the DB every time it
    has to. Are you really that annoyed for that 0.0003 second that it
    probably takes your pages to connect to the DB?

    What I do to manage just ONE connection request per visitor, is request
    a mainfile.php which also declares a function that connects to the DB.
    After that is prepared to handle all the queries you want.

    HTH,

    Cesar Aracena
    [url]www.icaam.com.ar[/url]
    > -----Mensaje original-----
    > De: Shivanischal [mailto:shivan@subexgroup.com]
    > Enviado el: Viernes, 05 de Septiembre de 2003 01:05 a.m.
    > Para: [email]php-general@lists.php.net[/email]
    > Asunto: [PHP] Persistent database connections in PHP
    >
    > Hi friends,
    >
    > I wanted help on how to achieve persistent database connections in
    PHP.
    > The
    > database i use is MySQL. I would be grateful if u could also guide me
    to
    > resources that tell me how to do it.
    >
    > Thanks,
    > -shiva
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    Cesar Aracena Guest

  2. Similar Questions and Discussions

    1. #39929 [NEW]: Persistent connections and ODBC
      From: aloucks at cofront dot net Operating system: Linux 2.4.31 PHP version: 5.2.0 PHP Bug Type: PDO related Bug...
    2. #39845 [NEW]: Persistent connections and PostgreSQL
      From: olivier at elma dot fr Operating system: Debian unstable PHP version: 5.2.0 PHP Bug Type: PDO related Bug description:...
    3. MSSQL persistent connections and PHP
      I've been having intermittent connection problems with my M$SQL 2000/Apache2/PHP set up. Every now and then the mssql_pconnect() would fail. M$SQL...
    4. mysql_pconnect() Do persistent connections ever die?
      Folks, I currently connect to my db with PHP code that uses non-persistent connections. I've read that persistent connections can help performance...
    5. Persistent database connections in PHP
      http://se.php.net/mysql_pconnect /David "Shivanischal" <shivan@subexgroup.com> wrote in message...
  3. #2

    Default RE: [PHP] Persistent database connections in PHP

    ooppss forgot this as well...

    [url]http://au2.php.net/mysql_pconnect[/url]
    > -----Original Message-----
    > From: Cody Phanekham
    > Sent: Friday, 5 September 2003 16:06
    > To: [email]php-general@lists.php.net[/email]
    > Subject: RE: [PHP] Persistent database connections in PHP
    >
    >
    > do people even look at the manual? or search the php.net website?
    >
    > http://au2.php.net/manual/en/ref.mysql.php
    >
    > "Runtime Configuration
    > The behaviour of these functions is affected by settings in php.ini.
    >
    > Here's a short explanation of the configuration directives.
    >
    > mysql.allow_persistent boolean
    > Whether to allow persistent connections to MySQL."
    >
    > so if you installed PHP without modifying the ini file, all
    > your connections should be persistent
    >
    >
    > > > -----Mensaje original-----
    > > > De: Shivanischal [mailto:shivan@subexgroup.com]
    > > > Enviado el: Viernes, 05 de Septiembre de 2003 01:05 a.m.
    > > > Para: php-general@lists.php.net
    > > > Asunto: [PHP] Persistent database connections in PHP
    > > >
    > > > Hi friends,
    > > >
    > > > I wanted help on how to achieve persistent database connections in
    > > PHP.
    > > > The
    > > > database i use is MySQL. I would be grateful if u could
    > > also guide me
    > > to
    > > > resources that tell me how to do it.
    > > >
    > > > Thanks,
    > > > -shiva
    > > >
    > > > --
    > > > PHP General Mailing List (http://www.php.net/)
    > > > To unsubscribe, visit: http://www.php.net/unsub.php
    > >
    > > --
    > > PHP General Mailing List (http://www.php.net/)
    > > To unsubscribe, visit: http://www.php.net/unsub.php
    > >
    > >
    >
    >
    > ************************************************** ************
    > ***********************
    > This e-mail, including any attachments to it, may contain
    > confidential and/or personal information.
    > If you have received this e-mail in error, you must not copy,
    > distribute, or disclose it, use or take any action
    > based on the information contained within it.
    >
    > Please notify the sender immediately by return e-mail of the
    > error and then delete the original e-mail.
    >
    > The information contained within this e-mail may be solely
    > the opinion of the sender and may not necessarily
    > reflect the position, beliefs or opinions of Salmat on any issue.
    >
    > This email has been swept for the presence of computer
    > viruses known to Salmat's anti-virus systems.
    >
    > For more information, visit our website at www.salmat.com.au.
    > ************************************************** ************
    > ***********************
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    >
    Cody Phanekham Guest

  4. #3

    Default Re: [PHP] Persistent database connections in PHP

    Just use the same header.
    and in the next page use
    <body onload=window.open(yourpage)>
    ....

    Murugesan

    ----- Original Message -----
    From: "Cesar Aracena" <lists@icaam.com.ar>
    To: "'Shivanischal'" <shivan@subexgroup.com>
    Cc: <php-general@lists.php.net>
    Sent: Friday, September 05, 2003 11:27 AM
    Subject: RE: [PHP] Persistent database connections in PHP

    > I haven't heard of persistent connections with MySQL before, and I think
    > is because PHP can't handle it. PHP will connect to the DB every time it
    > has to. Are you really that annoyed for that 0.0003 second that it
    > probably takes your pages to connect to the DB?
    >
    > What I do to manage just ONE connection request per visitor, is request
    > a mainfile.php which also declares a function that connects to the DB.
    > After that is prepared to handle all the queries you want.
    >
    > HTH,
    >
    > Cesar Aracena
    > www.icaam.com.ar
    >
    > > -----Mensaje original-----
    > > De: Shivanischal [mailto:shivan@subexgroup.com]
    > > Enviado el: Viernes, 05 de Septiembre de 2003 01:05 a.m.
    > > Para: php-general@lists.php.net
    > > Asunto: [PHP] Persistent database connections in PHP
    > >
    > > Hi friends,
    > >
    > > I wanted help on how to achieve persistent database connections in
    > PHP.
    > > The
    > > database i use is MySQL. I would be grateful if u could also guide me
    > to
    > > resources that tell me how to do it.
    > >
    > > Thanks,
    > > -shiva
    > >
    > > --
    > > PHP General Mailing List (http://www.php.net/)
    > > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    Murugesan Guest

  5. #4

    Default Re: [PHP] Persistent database connections in PHP

    On Fri, 5 Sep 2003, Shivanischal wrote:
    > I wanted help on how to achieve persistent database connections in PHP. The
    > database i use is MySQL. I would be grateful if u could also guide me to
    > resources that tell me how to do it.
    [url]http://www.php.net/manual/en/function.mysql-pconnect.php[/url]

    --
    Mika Tuupola [url]http://www.appelsiini.net/~tuupola/[/url]
    Mika Tuupola Guest

  6. #5

    Default Re: [PHP] Persistent database connections in PHP

    Murugesan wrote:
    > Just use the same header.
    > and in the next page use
    > <body onload=window.open(yourpage)>
    > ...
    >
    > Murugesan
    >
    ??????
    How will that accomplish a persistent databaseconnection?
    Erwin Moller Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139