/** * Insert one Row * * @param string $sTab = table * @param array $aData = values * @param boolean $gDebug statement output on/off * * @return mixed $result FALSE or insert id */ function libDbInsertRow($sTab, $aData, $gDebug = FALSE) { libDbExcuteQuery("INSERT", $sTab, $aData, array(), $gDebug); return libDbLastInsertId(); }
} elseif ($i === 1) { $aData1 = array("UniqueID" => 88888); $aData2 = array("UniqueID" => 77777); $rows = array($aData1, $aData2); $result = libDbInsertRows($sTab, $rows, $gDebug); } elseif ($i === 2) { $aData = array("UniqueID" => 11113); $result = libDbInsertRow($sTab, $aData, $gDebug); } elseif ($i === 3) { $aData = array("fname" => 77777); $aUpdate = array("id" => 49382); $result = libDbUpdateRow($sTab, $aData, $aUpdate, $gDebug); } $i = 2; if ($i === 0) { $sqlquery = "select * from {$sTab} where id > 49394"; $bResult = libDbQueryBySql($sqlquery); while ($bResult && ($row = libDbFetchAssoc())) { $result[] = $row; } } elseif ($i === 1) { $sqlquery = "insert into {$sTab} (UniqueId) values (11112)"; $bResult = libDbQueryBySql($sqlquery); if ($bResult === TRUE) { $result = libDbLastInsertId(); } } elseif ($i === 2) { $sqlquery = "update {$sTab} set UniqueId=22222 where UniqueId=11111"; $result = libDbQueryBySql($sqlquery); } var_dump($result);