Re: Efficient Connection To MySQL
- From: Andy Hassall <andy@xxxxxxxxxxx>
- Date: Wed, 01 Nov 2006 12:02:15 +0000
On 31 Oct 2006 11:39:52 -0800, "emrahayanoglu@xxxxxxxxx"
<emrahayanoglu@xxxxxxxxx> 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@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.
- References:
- Efficient Connection To MySQL
- From: emrahayanoglu@xxxxxxxxx
- Efficient Connection To MySQL
- Prev by Date: Re: sessions and domain names
- Next by Date: Re: Pulling date-specific data from flat file
- Previous by thread: Re: Efficient Connection To MySQL
- Next by thread: PHP scripting... An similiar awk command
- Index(es):
Relevant Pages
|