Code Duplication    Length = 19-19 lines in 9 locations

web_interface/astpp/system/database/drivers/cubrid/cubrid_driver.php 1 location

@@ 620-638 (lines=19) @@
617
	 * @param	array	the limit clause
618
	 * @return	string
619
	 */
620
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
621
	{
622
		foreach ($values as $key => $val)
623
		{
624
			$valstr[] = sprintf('"%s" = %s', $key, $val);
625
		}
626
627
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
628
629
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
630
631
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
632
633
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
634
635
		$sql .= $orderby.$limit;
636
637
		return $sql;
638
	}
639
640
	// --------------------------------------------------------------------
641

web_interface/astpp/system/database/drivers/mssql/mssql_driver.php 1 location

@@ 556-574 (lines=19) @@
553
	 * @param	array	the limit clause
554
	 * @return	string
555
	 */
556
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
557
	{
558
		foreach ($values as $key => $val)
559
		{
560
			$valstr[] = $key." = ".$val;
561
		}
562
563
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
564
565
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
566
567
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
568
569
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
570
571
		$sql .= $orderby.$limit;
572
573
		return $sql;
574
	}
575
576
577
	// --------------------------------------------------------------------

web_interface/astpp/system/database/drivers/mysql/mysql_driver.php 1 location

@@ 609-627 (lines=19) @@
606
	 * @param	array	the limit clause
607
	 * @return	string
608
	 */
609
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
610
	{
611
		foreach ($values as $key => $val)
612
		{
613
			$valstr[] = $key.' = '.$val;
614
		}
615
616
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
617
618
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
619
620
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
621
622
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
623
624
		$sql .= $orderby.$limit;
625
626
		return $sql;
627
	}
628
629
	// --------------------------------------------------------------------
630

web_interface/astpp/system/database/drivers/mysqli/mysqli_driver.php 1 location

@@ 605-623 (lines=19) @@
602
	 * @param	array	the limit clause
603
	 * @return	string
604
	 */
605
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
606
	{
607
		foreach ($values as $key => $val)
608
		{
609
			$valstr[] = $key." = ".$val;
610
		}
611
612
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
613
614
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
615
616
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
617
618
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
619
620
		$sql .= $orderby.$limit;
621
622
		return $sql;
623
	}
624
625
	// --------------------------------------------------------------------
626

web_interface/astpp/system/database/drivers/oci8/oci8_driver.php 1 location

@@ 688-706 (lines=19) @@
685
	 * @param	array	the limit clause
686
	 * @return	string
687
	 */
688
	protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
689
	{
690
		foreach ($values as $key => $val)
691
		{
692
			$valstr[] = $key." = ".$val;
693
		}
694
695
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
696
697
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
698
699
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
700
701
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
702
703
		$sql .= $orderby.$limit;
704
705
		return $sql;
706
	}
707
708
	// --------------------------------------------------------------------
709

web_interface/astpp/system/database/drivers/odbc/odbc_driver.php 1 location

@@ 526-544 (lines=19) @@
523
	 * @param	array	the limit clause
524
	 * @return	string
525
	 */
526
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
527
	{
528
		foreach ($values as $key => $val)
529
		{
530
			$valstr[] = $key." = ".$val;
531
		}
532
533
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
534
535
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
536
537
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
538
539
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
540
541
		$sql .= $orderby.$limit;
542
543
		return $sql;
544
	}
545
546
547
	// --------------------------------------------------------------------

web_interface/astpp/system/database/drivers/pdo/pdo_driver.php 1 location

@@ 614-632 (lines=19) @@
611
	 * @param	array	the limit clause
612
	 * @return	string
613
	 */
614
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
615
	{
616
		foreach ($values as $key => $val)
617
		{
618
			$valstr[] = $key." = ".$val;
619
		}
620
621
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
622
623
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
624
625
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
626
627
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
628
629
		$sql .= $orderby.$limit;
630
631
		return $sql;
632
	}
633
	
634
	// --------------------------------------------------------------------
635

web_interface/astpp/system/database/drivers/postgre/postgre_driver.php 1 location

@@ 589-607 (lines=19) @@
586
	 * @param	array	the limit clause
587
	 * @return	string
588
	 */
589
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
590
	{
591
		foreach ($values as $key => $val)
592
		{
593
			$valstr[] = $key." = ".$val;
594
		}
595
596
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
597
598
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
599
600
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
601
602
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
603
604
		$sql .= $orderby.$limit;
605
606
		return $sql;
607
	}
608
609
	// --------------------------------------------------------------------
610

web_interface/astpp/system/database/drivers/sqlite/sqlite_driver.php 1 location

@@ 540-558 (lines=19) @@
537
	 * @param	array	the limit clause
538
	 * @return	string
539
	 */
540
	function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
541
	{
542
		foreach ($values as $key => $val)
543
		{
544
			$valstr[] = $key." = ".$val;
545
		}
546
547
		$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
548
549
		$orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : '';
550
551
		$sql = "UPDATE ".$table." SET ".implode(', ', $valstr);
552
553
		$sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : '';
554
555
		$sql .= $orderby.$limit;
556
557
		return $sql;
558
	}
559
560
561
	// --------------------------------------------------------------------