
Originally Posted by
IlyaDevyatovsky
httpd couldn't take 100% all the time as the average was 1.64%. Did I miss anything?
How do you parse the result of query? How does your script take the values out of the class, what is the method for this?
As an example -- how would you script proceed if you need to print out 100 values from a database using your DB class?
that log snipplet was when the sit was running good, I have not seen one when the cpu is maxed out.
I use this to fetch all the rows, either in a while look or a for loop.
PHP Code:
function fetch($Query_ID=-1) {
if (isset($this->Query_ID)) {
$this->record = mysql_fetch_array($this->Query_ID);
} else {
if (!empty($Query_String)) {
$this->halt("Invalid query id (".$this->Query_ID.") on this query: $Query_String");
} else {
$this->halt("Invalid query id ".$this->Query_ID." specified");
}
}
for instance it would go something like this
PHP Code:
$db_down = new DB;
$db_down->connect();
$sql2 = $db_down->query("SELECT mp_prodid, mp_downloadUrl from $memprod where mp_prodid= '$id'");
if ($db_down->num_rows($sql2)){
$row = $db_down->fetch($sql2);
etc...
Bookmarks