XMC: xmDB Object

xmDB adalah object yang menangani koneksi database dalam sistem.

Method:

  • public static function SQL(string $SQL) : Dataset
  • public static function Fetch (Dataset $RS, $Mode=MYSQLI_ASSOC)
  • public static function Count (Dataset $RS) : int
  • public static function GetID() : int
  • public static function RowAffected() : int
Contoh penggunaannya :
<?php

$SQL = "select myString, myInt, myDate, myDecimal from myTable";
$rs = \xmDB::SQL ($SQL);
while ($row ==\xmDB::Fetch($rs))
{
    $varString = xmDB::RowString($row, "myString");
    $varString = xmDB::RowInteger($row, "myInt");
    $varDate = xmDB::RowDate($row, "myDate");
    $varDecimal = xmDB::RowDecimal($row, "myDecimal");
}

$SQL = "insert into myData (id, name) values (1, 'test')";
\xmDB::SQL ($SQL);

?>

No comments:

Post a Comment