@@ 365-377 (lines=13) @@ | ||
362 | * @param string $cond Condition, can be where, having etc, raw sql string, not null. |
|
363 | * @return int -1 error/0 not found/N > 0 number of rows |
|
364 | */ |
|
365 | public function DelRow ($tbl, $cond) { |
|
366 | $cond = trim($cond); |
|
367 | if (empty($cond)) |
|
368 | return -1; |
|
369 | $this->PExecute($this->GenSql(array( |
|
370 | 'DELETE' => $tbl, |
|
371 | )) . ' ' . $cond); |
|
372 | if (0 != $this->ErrorNo()) |
|
373 | // Execute error |
|
374 | return -1; |
|
375 | else |
|
376 | return $this->Affected_Rows(); |
|
377 | } // end of func DelRow |
|
378 | ||
379 | ||
380 | /** |
@@ 448-471 (lines=24) @@ | ||
445 | * @param string $condition Not empty, can be raw sql where, having etc |
|
446 | * @return int |
|
447 | */ |
|
448 | public function deleteRow($table, $condition) |
|
449 | { |
|
450 | $condition = trim($condition); |
|
451 | if (empty($condition)) { |
|
452 | return -1; |
|
453 | } |
|
454 | ||
455 | $this->executePrepare( |
|
456 | $this->getSqlGenerator()->get(['DELETE' => $table]) |
|
457 | . ' ' . $condition |
|
458 | ); |
|
459 | ||
460 | if (0 != $this->conn->ErrorNo()) { |
|
461 | // @codeCoverageIgnoreStart |
|
462 | // Error is rollbacked, no errorno return |
|
463 | ||
464 | // Execute error |
|
465 | return -1; |
|
466 | ||
467 | // @codeCoverageIgnoreEnd |
|
468 | } else { |
|
469 | return $this->conn->Affected_Rows(); |
|
470 | } |
|
471 | } |
|
472 | ||
473 | ||
474 | /** |