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

Posted by Andy Hassall on 11/01/06 12:02

On 31 Oct 2006 11:39:52 -0800, "emrahayanoglu@gmail.com"
<emrahayanoglu@gmail.com> wrote:

>I have question about efficient usage of connecting to mysql. Now, i'm
>using 6 or 7 queries in a page with ajax. In Addition to that, i open
>connection to mysql for every query. I think it isn't efficient way.

What proportion of time is actually spent on connection vs the rest of the
script - benchmark it and address the parts you can measure to be costly rather
than guessing.

>However, when i open only one connection to use for every query, php
>interpreter gives error. What should i do for efficent use of
>connecting to mysql?

What error do you get?

Since you mention AJAX then each of these requests is a new PHP request -
you're not perhaps trying to open a MySQL connection in the "parent" page and
then assuming the MySQL connection resource variable will be available in the
requests serving the AJAX events?

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

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

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