RE: CPU usage @5% during 2 minutes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The sample code (in seperate, this piece of code runs with normal speed,
but it is this part which runs slowly when executed as a whole,
everything else is fast):


	$sqlquery = "SELECT sh_Number, sh_Status FROM service_sheet ORDER BY
sh_Number DESC";
	$result = mysql_query($sqlquery)
	or die (mysql_error()."<br><br>"._ERROR_QUERY.": ".$sqlquery);
	echo " <SELECT onchange=\"this.form.service_sheet_worknum.value =
this.value;\" class=\"service_sheet_list\" name=\"service_sheet\">";
	while (list($shID, $shStatus, $shWNum, $custName) =
mysql_fetch_row($result)) {
		switch ($shStatus) {
		case 1:
			$option_class = "status_1";
			break;
		case 2:
			$option_class = "status_2";
			break;
		case 3:
			$option_class = "status_3";
			break;
		case 4:
			$option_class = "status_4";
			break;
		case 5:
			$option_class = "status_5";
			break;
		}
		echo "<OPTION class=\"$option_class\" value=\"$shID\">$shID</OPTION>";
		}
	 echo "</SELECT>&nbsp;&nbsp;&nbsp;&nbsp;"._OR;?>

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux