Example #1
0
/**
 * Alias of dbAffectedRows();
 * @link dbAffectedRows()
 */
function dbGetLastEffectedRows()
{
    dbAffectedRows();
}
Example #2
0
     $w .= "codant = '" . $codigo_ant . "', ";
     $w .= "nombre = '" . $nombre . "', ";
     $w .= "marca_id = " . $marca . ", ";
     $w .= "categoria_id = " . $cat . ", ";
     $w .= "scategoria_id = " . $scat . ", ";
     $w .= "sscategoria_id = " . $sscat . ", ";
     $w .= "peso = " . $peso . ", ";
     $w .= "uni_med = " . $uni_med . ", ";
     $w .= "caja = " . $caja . ", ";
     $w .= "mayoreo = " . $mayoreo . ", ";
     $w .= "codigo_barra = '" . $codigo_barra . "', ";
     $w .= "detalle = '" . $detalle . "' ";
     $w .= " WHERE id={$id_art}";
     //echo $w;
     dbQuery($w);
     if (dbAffectedRows() > 0) {
         echo 'exito|' . $id_art;
     } else {
         echo 'fracaso';
     }
     break;
 case "eliminar_articulo":
     $id_art = $_GET['id_art'];
     $q = "UPDATE articulo SET active = 0 WHERE id={$id_art}";
     $result = dbQuery($q);
     if ($result) {
         echo "exito";
     } else {
         echo "fracaso";
     }
     break;
Example #3
0
function dbDelete($table, $where = NULL, $parameters = array())
{
    $sql = 'DELETE FROM `' . $table . '`';
    if ($where) {
        $sql .= ' WHERE ' . $where;
    }
    $time_start = microtime(true);
    if (dbQuery($sql, $parameters)) {
        $return = dbAffectedRows();
    } else {
        $return = FALSE;
    }
    $time_end = microtime(true);
    $GLOBALS['db_stats']['delete_sec'] += number_format($time_end - $time_start, 8);
    $GLOBALS['db_stats']['delete']++;
    return $return;
}