Re: [PHP] Avoid to open mysql querries then times in the page

2009-05-06 Thread Michael A. Peters
tedd wrote: On 5/4/09, Matthieu wrote: Hello, I'm a totally newbie to php/Mysql but I'd like to know if it is normal that I have to connect 3 times to the db in one page. For example, I have 1. A connection for the login / pass a $_SESSION['login'] before the HTML tags 2. I need

RE: [PHP] Avoid to open mysql querries then times in the page

2009-05-05 Thread Daevid Vincent
> -Original Message- > From: tedd [mailto:tedd.sperl...@gmail.com] > Sent: Tuesday, May 05, 2009 7:55 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Avoid to open mysql querries then times in the page > > On 5/4/09, Matthieu wrote: > > Hello, &g

RE: [PHP] Avoid to open mysql querries then times in the page

2009-05-05 Thread Daevid Vincent
> -Original Message- > From: tedd [mailto:tedd.sperl...@gmail.com] > Sent: Tuesday, May 05, 2009 7:55 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Avoid to open mysql querries then times in the page > > On 5/4/09, Matthieu wrote: > > Hello, &g

Re: [PHP] Avoid to open mysql querries then times in the page

2009-05-05 Thread tedd
On 5/4/09, Matthieu wrote: Hello, I'm a totally newbie to php/Mysql but I'd like to know if it is normal that I have to connect 3 times to the db in one page. For example, I have 1. A connection for the login / pass a $_SESSION['login'] before the HTML tags 2. I need to say hello to t

Re: [PHP] Avoid to open mysql querries then times in the page

2009-05-04 Thread Ashley Sheridan
On Mon, 2009-05-04 at 23:09 +0030, Bastien Koert wrote: > Yep, though I would still query 2x. Once for the login data, no sense > retrieving more if the log on fails. Then the second query is to get > all the user data into a session object. There are two schools of > thought about this, pull all t

Re: [PHP] Avoid to open mysql querries then times in the page

2009-05-04 Thread Bastien Koert
Yep, though I would still query 2x. Once for the login data, no sense retrieving more if the log on fails. Then the second query is to get all the user data into a session object. There are two schools of thought about this, pull all the required data into the session, which doesn't scale well but

[PHP] Avoid to open mysql querries then times in the page

2009-05-04 Thread Matthieu
Hello, I'm a totally newbie to php/Mysql but I'd like to know if it is normal that I have to connect 3 times to the db in one page. For example, I have 1. A connection for the login / pass a $_SESSION['login'] before the HTML tags 2. I need to say hello to the user so I reconnect, run a qu