예제 #1
0
 function _setValues()
 {
     $log = new LogDatabaseQueryTopTenTitles(LOGDEF);
     $total = $log->getTotalArticles();
     if ($total == 0) {
         if (($error = $log->getMySQLError) != MYSQL_SUCCESS) {
             echo "Error: " . $log->getMySQLError();
         } else {
             echo "Total: 0";
         }
         exit;
     }
     if (!($result = $log->executeQuery())) {
         echo "Error: " . $log->getMySQLError();
         exit;
     }
     $sum = 0;
     for ($i = 0; $i < mysql_num_rows($result); $i++) {
         $row = mysql_fetch_array($result);
         $this->_data[$i] = $row["total"];
         $sum += $this->_data[$i];
         $this->_legends[$i] = $row["title"];
     }
     $this->_data[sizeof($this->_data)] = $total - $sum;
     $this->_legends[sizeof($this->_legends)] = "Other Titles";
     $log->destroy();
 }
예제 #2
0
        break;
    case 'es':
        echo "N&uacute;mero de accessos a art&iacute;culos";
        break;
    default:
        echo "Number of article requests";
}
?>
    </b>
    </td>
</tr>
<?php 
include_once "classLogDatabaseQueryTopTenTitles.php";
define("LOGDEF", "../scielo.def");
define("MYSQL_SUCCESS", 0);
$log = new LogDatabaseQueryTopTenTitles(LOGDEF);
$total = $log->getTotalArticles();
if ($total == 0) {
    if (($error = $log->getMySQLError) != MYSQL_SUCCESS) {
        echo "Error: " . $log->getMySQLError();
    } else {
        echo "Total: 0";
    }
    exit;
}
if (!($result = $log->executeQuery())) {
    echo "Error: " . $log->getMySQLError();
    exit;
}
$log->destroy();
$sum = 0;