php or mysql

This is a discussion on php or mysql within the PHP Language forums, part of the PHP Programming Forums category; Hi. I am making a page that lots of data on the first page that I want links displayed in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-11-2004
alex
 
Posts: n/a
Default php or mysql

Hi. I am making a page that lots of data on the first page that I want links
displayed in a random order. If lots of people are looking at it, would I be
better using a page that uses arrays and shuffle(), or would I be ok to use
mysql.
If there are over a hundred visitors a day, would mysql be making the site
slow?
I don't know much about hardware, and if using mysql to get data for a front
page is too much, could it overload mysql?

Is there any point where it's better to use php to write html rather than
query a database everytime the page loads?

I would be very happy if anyone could explain this, because I could not find
the answer in books or on the web.

Alex


Reply With Quote
  #2 (permalink)  
Old 10-11-2004
Tony Marston
 
Posts: n/a
Default Re: php or mysql

100 visitors a day is nothing. Don't worry about it until you get 100
visitors a second.

--
Tony Marston

http://www.tonymarston.net



"alex" <nospam@nospam.com> wrote in message
news:ckdpdo$jou$1@sparta.btinternet.com...
> Hi. I am making a page that lots of data on the first page that I want
> links
> displayed in a random order. If lots of people are looking at it, would I
> be
> better using a page that uses arrays and shuffle(), or would I be ok to
> use
> mysql.
> If there are over a hundred visitors a day, would mysql be making the site
> slow?
> I don't know much about hardware, and if using mysql to get data for a
> front
> page is too much, could it overload mysql?
>
> Is there any point where it's better to use php to write html rather than
> query a database everytime the page loads?
>
> I would be very happy if anyone could explain this, because I could not
> find
> the answer in books or on the web.
>
> Alex
>
>



Reply With Quote
  #3 (permalink)  
Old 10-11-2004
CJ Llewellyn
 
Posts: n/a
Default Re: php or mysql

"alex" <nospam@nospam.com> wrote in message
news:ckdpdo$jou$1@sparta.btinternet.com...
> Hi. I am making a page that lots of data on the first page that I want

links
> displayed in a random order. If lots of people are looking at it, would I

be
> better using a page that uses arrays and shuffle(), or would I be ok to

use
> mysql.


You are far better off reading only the records/fields from the database
which you need and in the order you need them than to load the whole lot
into memory and process them there.

SELECT * FROM foo ORDER BY RAND()

> If there are over a hundred visitors a day, would mysql be making the site
> slow?


If your site content doesn't change much then php/mysql will make the site
slower than having static html pages. However the cost of hardware is
comparitively little compared to the cost of you editing lots of files to
make a style change for instance.

> I don't know much about hardware, and if using mysql to get data for a

front
> page is too much, could it overload mysql?


If your design is bad, and you've got lots of other resource hungry
applications on the server then yes.

> Is there any point where it's better to use php to write html rather than
> query a database everytime the page loads?


You need the data from somewhere, mysql (a.n.other rdms) happens to be in
most circumstances a lot easier and faster than embeding code into a
specific file. For example you can easily change the contents of the main
page using an CMS user interface rather then editing the file in a HTML
Editor and then uploading that file using FTP.


Reply With Quote
  #4 (permalink)  
Old 10-12-2004
Chung Leong
 
Posts: n/a
Default Re: php or mysql

"alex" <nospam@nospam.com> wrote in message
news:ckdpdo$jou$1@sparta.btinternet.com...
> Hi. I am making a page that lots of data on the first page that I want

links
> displayed in a random order. If lots of people are looking at it, would I

be
> better using a page that uses arrays and shuffle(), or would I be ok to

use
> mysql.
> If there are over a hundred visitors a day, would mysql be making the site
> slow?
> I don't know much about hardware, and if using mysql to get data for a

front
> page is too much, could it overload mysql?
>
> Is there any point where it's better to use php to write html rather than
> query a database everytime the page loads?
>
> I would be very happy if anyone could explain this, because I could not

find
> the answer in books or on the web.
>
> Alex
>


It all depends on how often the data changes. If it changes infrequently,
then it's probably not worth the effort to use a database.


Reply With Quote
  #5 (permalink)  
Old 10-13-2004
alex
 
Posts: n/a
Default Re: php or mysql

Thanks for the help everyone.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0