Re: Efficient Connection To MySQL



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
.



Relevant Pages

  • Re: VFP8 & MySQL
    ... > VFP functions like NVL to a MySQL one, definitely it made the switch very ... > About your connection problem, I have mine setup as default for 100 ... As for the server, we left it ... The server crashed and corrupted the database. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: asp + mysql and simultaneous requests result in IIS 500 error
    ... > ASP pages send out simultaneous requests to another ASP page which in ... > ASP pages that put out requests to ASP pages which in turn try to ... > retrieve data from the MySQL database, I get a 500 error code. ... > caused by the DSNless connection? ...
    (microsoft.public.inetserver.asp.general)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)
  • MySQL on Win 98
    ... I'm just getting into MySQL and I'm trying to learn about it at home. ... and created a DSN connection for it. ... User: root ... ODBC Data Source Administrator and get a "success" result. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VFP8 & MySQL
    ... Main Location and 3 branches (these are remotely accessing MySQL at the main ... About your connection problem, I have mine setup as default for 100 ... As for the server, we left it alone. ... The server crashed and corrupted the database. ...
    (microsoft.public.fox.programmer.exchange)