|
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]
|