Hello and thanks for viewing
This might be simple - I built a search for my website and I want to display how long it took to return the results at the top of the page. Here is watered down version of the script:
$search = $_POST['search'];
//stemmer search, sql injection, add slashes, bla, bla,bla all that good stuff
$start_time = microtime(true);
$query = "SELECT * FROM $table
LEFT JOIN files.itemmast on PITEM = IITEM AND ICO = '1'
WHERE IMFGNO NOT LIKE 'DISC%' AND IMFGNO <> 'DISC' AND ISTATS <> 'V' AND ISPCOD <> 'M' AND ";
$query = $query."";
$stmt = db2_prepare($i5db2, $query)
or die("Prepare error: " . db2_stmt_errormsg());
$query_result = db2_exec($i5db2, $query);
// output list of articles
$count = 0;
while($row = db2_fetch_assoc($query_result)){
echo $row['somedata'];
echo $row['moredata'];
}
$end_time = microtime(true);
//HOW DO I DISPLAY THIS UP TOP
$query_time = "Search was generated in:" . round(($end_time - $start_time),5) . " seconds\n";
That is a just simple overview but how would I go about showing $query_time at the top of my page?? My form is using $_SERVER['PHP_SELF'];
Thanks in advance!
j