Beginners PHP / mySQL question
Posted
by Reg H
on Stack Overflow
See other posts from Stack Overflow
or by Reg H
Published on 2010-03-15T14:36:11Z
Indexed on
2010/03/15
14:39 UTC
Read the original article
Hit count: 137
I'm brand new to PHP & MySQL, and one function I'm creating needs to access a large table or database. I've created the database and it's currently in a MySQL table, which I'm accessing with no problem. The table is 11,000 rows in length, with 8 columns (all text less than 8 characters long) - it's static, and will never change. Without getting too particular, my users will hit a button which will trigger scripts to access the data, say 500 times or more. So in general would it be better practice to include all of this data in a big 'switch' or 'if... then' conditional right in my scripts, rather than opening and accessing the database connection hundreds, or maybe even thousands of times? It just seems like that might be a bottleneck waiting to happen. Thanks!
© Stack Overflow or respective owner