By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

Sql query or apache file read?

P: n/a
Hello people,

I'm optimizing my script because my server is under heavy load in the
evening.

I have a question which methode is more efficient for my server:

==================
//connection with database is already open because other queries where
executed first.

$sql="select * from category where siteid=?" // category table
contains about 1000 records, only 10 are returned

//loop with php code through resultset and print the name and id's of
category
==================

or

==================
<script src="cat.js"></script>

cat.js contains javascript document.write() instruction to write 10
categories.
==================

In simple words: which is more efficient, a sql query with php or a
file read done by apache?

Thanks ;)
Jaap
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Jaap de Bergen" <DEBERGEN.COM@REMOVE_THIS_TO_EMAILdomainsbyproxy.c om >
wrote in message news:2b********************************@4ax.com...
In simple words: which is more efficient, a sql query with php or a
file read done by apache?


A static file served by Apache is always faster.
Jul 17 '05 #2

P: n/a
On Sun, 9 May 2004 22:14:52 -0400, "Chung Leong"
<ch***********@hotmail.com> wrote:
"Jaap de Bergen" <DEBERGEN.COM@REMOVE_THIS_TO_EMAILdomainsbyproxy.c om >
wrote in message news:2b********************************@4ax.com...
In simple words: which is more efficient, a sql query with php or a
file read done by apache?


A static file served by Apache is always faster.


That's good news. Thanks for the reply Chung!
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.