You are here: Re: [PHP] php/mysql web question « PHP « IT news, forums, messages
Re: [PHP] php/mysql web question

Posted by Mikey on 09/06/05 15:46

Mikey wrote:

> bruce wrote:
>
>> hi...
>>
>> if an app has a webpage that has to interface/display data from a
>> mysql db,
>> does the app have to essentially do a new db_connection for each time
>> that a
>> user accesses the page during the session.
>>
>> as far as i can tell, it does.
>>
>> in other words, the page would need to look something like:
>>
>> <?
>> start the page
>> do the db_connect
>> do the db_query
>> process the information from the db/tbl
>> close the db_connection
>> ?>
>>
>> the only reason i ask is that it would be nice/good if there was some
>> way of
>> opening a connetion once for a given session (save bandwidth) as well as
>> somehow saving data from the db/tbl (short of using session vars)
>>
>> thanks
>>
>> -bruce
>> bedouglas@earthlink.net
>>
>>
>>
> What you should use is a persistent connection - mysql_pconnect() - IIRC
>
> HTH,
>
> Mikey
>
Ooops, forgot the second part of your question - if you want to save the
data from a query then you will have to use session vars, although only
do this with data that you know will not change during the lifetime of a
user session.

Mikey

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация