Number of requests SQL

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 26, 2008   (RSS)

By Djulia - November 25, 2008

Hi,

It would be possible to know the number total of requests SQL on the public pages ( pageList.php and pageDetail.php ) ?

For example :
Homepage :154 query SQL
Story : 106 query SQL
etc..

An idea ?

Thanks for your assistance.

Djulia

Re: [Djulia] Number of requests SQL

By Dave - November 25, 2008

Hi Djulia,

Do you want to create a hit counter? You can do that like this:

Create a field called 'hits' (or whatever you want to call it) add this in your page. Then use this code. This first field is the tablename, the second field is the fieldname, and the third field is the record number

<?php incrementCounterField('news', 'hits', $newsRecord['num']); ?>

Or do you want to know the number of SQL queries executed? (If so, curious what for?)
Dave Edis - Senior Developer
interactivetools.com

Re: [Djulia] Number of requests SQL

By Dave - November 25, 2008

Hi Djulia,

How slow is it? You can display the total time at the bottom of the page like this:

<?php showExecuteSeconds() ?> seconds

CMS Builder does do some extra MySQL queries, and you can reduce those if needed. But it's likely the web host since CMS Builder is fast on many other hosts.

In our experience the best way to convince a web host is to write a short script that demonstrates the problem so they can't blame it on the software. I've attached a script I recently wrote the times the MySQL connection speed. (This may or may not be the problem).

On the client's host I wrote this for it took 9 seconds just to connect to MySQL - not even to run any queries.

Try this one, just change the login info at the top. Then let me know what happens.
Dave Edis - Senior Developer
interactivetools.com
Attachments:

test-mysql.php 2K

Re: [Dave] Number of requests SQL

By Djulia - November 26, 2008 - edited: November 26, 2008

Thank you Dave, [:)]

That functioned well, and other customers also informed them of the problem.
Our ISP thus took time to look at. There was a problem of memory (ram) on server SQL.
They will do what is necessary.

Sometimes, they have a little difficulties for hearing the customers…

We preciously keep your file for the future.

Thanks,

Djulia