123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /* Authors : Carlos C. Corrada-Bravo
- David J. Ortiz-Rivera
-
- Organization : Centro de Desarrollo y Consultoria Computacional
- Project : OPASO Material Registry
- File : extract.php
- Description : Extract and insert data from tsv. */
-
- /* Import database connection & display errors */
- include_once "config.php";
- error_reporting(E_ALL);
- ini_set("display_errors",1);
-
- /* Initiate statement */
- $amount = $db->stmt_init();
- if($amount = $db->prepare("SELECT eid,amount,quantity,total FROM Inventory WHERE amount!='n/a' AND quantity!='n/a' AND total!='n/a'")){
- /* execute */
- if($amount->execute()){
- /* fetch result by rows and generate response to script */
- $result = $amount->get_result();
- $response = array();
- while($mult = $result->fetch_assoc()){
- $key = $mult["eid"];
- $a = $mult["amount"];
- $q = $mult["quantity"];
- $t = $mult["total"];
- if(floatval($a)*floatval($q) != floatval($t)){
- echo $key . '<br>';
- //echo floatval($a)*floatval($q) . ' ' . floatval($t) . '<br>';
- }
- }
-
- }
- }
- ?>
|