Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] PHP & mySQL populating HTML table


[SOLVED] PHP & mySQL populating HTML table

Reply
  #21 (permalink)  
Old 04-24-08, 01:31 PM
de.monkeyz's Avatar
de.monkeyz de.monkeyz is offline
Wannabe Coder
 
Join Date: Apr 2008
Location: Leeds, UK
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
I know that adding ' to keys like 'post_title' makes it 7-10 times faster, so it's very good practice to do that

Only way I can think of testing is using time() when the script begins and ends (maybe repeat commands to make noticeable times) so you can see how many milliseconds it took.
__________________
Wanna learn AJAX? Goto http://www.deathmonkeyz.com/tutorials for free video tutorials.

AJAX - Lesson 11 - AJAX Guestbook (23/8/08)
C++ - Lesson 10 - Classes (24/8/08)
JavaScript - Lesson 03 - The DOM (24/8/08)
Need an AJAX app? Look no further, I'm available for work

Last edited by de.monkeyz; 04-24-08 at 01:35 PM.
Reply With Quote
  #22 (permalink)  
Old 04-24-08, 03:20 PM
Jay6390's Avatar
Jay6390 Jay6390 is offline
Code Master
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,330
Thanks: 0
Thanked 0 Times in 0 Posts
Here's the way I tested it. It uses microtime, since time would not actually do anything
PHP Code:

$mtime microtime();
$mtime explode(" ",$mtime);
$mtime $mtime[1] + $mtime[0];
$starttime $mtime;
//////////////////////////////////////////////////////////////////////////////////////////////////////////
$i=0;
$j='';
$k=array('Test','Script');

for(
$i=0;$i<50000;$i++)
    
$j=$k[1];#DELETE AS APPROPRIATE
    #$j=$k['1'];#UNCOMMENT AS APPROPRIATE

//////////////////////////////////////////////////////////////////////////////////////////////////////////
$mtime microtime();
$mtime explode(" ",$mtime);
$mtime $mtime[1] + $mtime[0];
$endtime $mtime;
$totaltime = ($endtime $starttime);
echo 
"This page was created in ".$totaltime." seconds"
Make sure you have only the first or the second line after the for loop
EDIT: Also, try it about 5 or 6 times minimum, to get a fair average

Jay
__________________
Useful Tutorials
[ PHP Video-1-2-3 ] [ MySQL 1-2-3 ]
For any php function reference type

www.php.net/FunctionName

Last edited by Jay6390; 04-24-08 at 03:25 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
For Hire (3 years exp.): Looking for Php, Mysql, AJAX, JavaScript, HTML, XML Barkat Job Offers & Assistance 1 09-25-07 04:15 PM
PHP not recognizing admin in MySQL gizelle Database 3 04-15-07 08:39 PM
Need help with some php mysql TheTinkeringToad PHP 9 02-01-06 10:56 AM
IIS MYSQL and PHP nommiiss PHP 6 01-31-06 04:30 PM
html in php from mysql jasondavis PHP 3 12-04-04 10:01 PM


All times are GMT -5. The time now is 07:43 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.