You are here: Re: Efficient Connection To MySQL « PHP Programming Language « IT news, forums, messages
Re: Efficient Connection To MySQL

Posted by Jerry Stuckle on 11/01/06 03:02

SquishedOrange@gmail.com wrote:
> You should be able to send more than one query to mysql through one
> connection.
>

True. I normally use one connection per page.

> Can you show the code please?
>
> You could also use a persistant connection if your site is in frequent
> use and your host supports it. mysql_pconnect(). I would hesitate
> before using that though...
>

Ugh. Don't even suggest this. Unless the site's getting around 1M or
more hits per day persistent connections take more resources than they save.

> If you say connecting to database takes "3" in processing time.
> Sending a select query takes about 1. **
> So your performing 4 for every query, which is very inefficient.
>
>
> ** Depends on server type, installation & load.
>

Definitely. You do not need a new connection for each query. Just
learn to keep track of your connections.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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