Avoid to open mysql querries then times in the page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 query to select the user having the login and echo 'Hello '.$user['login'].'!''

3. I need to show him his friends a bit later, so I have to connect a last time and re-run a querry because I can't use the data $user that I used in my upper php code...


Is there a walkthroug to have only one connection for the page?

Thanks

Matthieu

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux