The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How many queries is too many queries??
Hello everyone, I was wondering if someone can clarify how many queries per page is too many per script. For example my php file below. This is used to get the specific image URL for each option of the form. I know I may have been able to use some sort of array but my php knowledge is very limited still but learning fast. I wonder if this is an overkill for the server although page load time is under a second, I don't know how this many queries per file might affect when used in a live large board for example. If anyone has any input or feedback or if someone knows how I can run the same script but differently and more efficient please don't hold back. Here is the said php file;
PHP Code:
|
#2
|
|||
|
|||
Code:
$result = $db->query_read(" SELECT imgurl FROM oftw_nominations ORDER BY id ASC LIMIT 7 "); $output = '<div id=lightboximages class=blockbody> <form cellpadding=10 border=1 action=oftw_insert_vote.php method=post> <tr>'; foreach($result as $key => $row) { $output .= '<td><center>' . $key . '.<input type=radio name=votes value=' . $key . '><a href=testlightbox.php?id=' .$key. ' rel=Lightbox_1 id=image'. $key .'1><img src ='.$row.' style=vertical-align:middle;padding-bottom:5px;></a></center></td>'; }; $output .= '</tr> <center><input type=submit name=submitvote style=width:70px;></center> </form> </div>'; echo "$output"; sidenote: http://www.php.net/ is a great source for php functions. =) |
Благодарность от: | ||
Jhonnyf |
#3
|
|||
|
|||
Thanks for the reply Moof, but every time I try and use your code replacing mine I can't access the site for some reason. All pages of the site go blank.... In any case I was able to shrink the echos using your method and page load time reduced by a few milliseconds Every little bit helps I suppose. I wonder why I am getting those blank screens though with the rest of your code.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|