當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRow::addColumn方法代碼示例

本文整理匯總了PHP中CRow::addColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRow::addColumn方法的具體用法?PHP CRow::addColumn怎麽用?PHP CRow::addColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRow的用法示例。


在下文中一共展示了CRow::addColumn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CRows

echo "<br> Read table data ...";
$rowsRes = new CRows();
$db->read("person", $rowsRes);
$it = $rowsRes->createIterator();
for ($it->first(); !$it->isDone(); $it->next()) {
    $row_it = $it->currentItem();
    echo "<br> ";
    print $row_it->getColumnValue("id");
    echo " |";
    print $row_it->getColumnValue("name");
}
echo "<br> PASSED: db->read('person', rowsRes);";
echo "<br> Testing Delete method";
$rowDel = new CRow();
echo "<br> PASSED: new CRowDel";
$rowDel->addColumn("name", "test");
echo "<br> PASSED: new rowDel>addColumn('name', 'test');";
$db->Delete("person", $rowDel);
echo "<br> PASSED: db->Delete('person', rowDel);";
echo "<br> Read table data ...";
$rowsRes2 = new CRows();
$db->read("person", $rowsRes2);
$it2 = $rowsRes2->createIterator();
for ($it2->first(); !$it2->isDone(); $it2->next()) {
    $row_it2 = $it2->currentItem();
    echo "<br> ";
    print $row_it2->getColumnValue("id");
    echo " |";
    print $row_it2->getColumnValue("name");
}
echo "<br>=== TEST PASSED ===";
開發者ID:UnstoppableMomentum,項目名稱:synopsis-php,代碼行數:31,代碼來源:delete.php

示例2: Counter

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<html>
<body>

<?php 
echo "Test for PHP-DAO insert method";
$db = new Counter();
$db->open();
$row = new CRow();
echo "<br> PASSED: new CRow";
$row->addColumn("name", "test");
echo "<br> PASSED: row->addColumn";
$db->insert("person", $row);
echo "<br> PASSED: row->insert";
$rows = new CRows();
echo "<br> PASSED: CRows";
echo "<br> size:";
print $rows->size();
echo "<br> PASSED: rows->size()";
$rows->pushBack($row);
echo "<br> PASSED: rows->pushBack()";
echo "<br> size:";
print $rows->size();
$db->read($rows);
echo "<br>  PASSED: data accessor read";
$it = $rows->createIterator();
echo "<br> PASSED: createIterator";
for ($it->first(); !$it->isDone(); $it->next()) {
    $row_it = $it->currentItem();
    echo "<br> ";
開發者ID:UnstoppableMomentum,項目名稱:synopsis-php,代碼行數:31,代碼來源:addcolumn.php

示例3: CRow

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<html>
<body>

<?php 
echo "Test for PHP-DAO CRow::AddColumn method";
$row = new CRow();
echo "<br> PASSED: new CRow";
$row->addColumn("id", 1);
echo "<br> row->addColumn('id', 1)";
$row->addColumn("name", "test");
echo "<br> row->addColumn('name', 'test')";
$row->addColumn("val", 0.5);
echo "<br> row->addColumn('val', 0.5)";
echo "<br>=== TEST PASSED ===";
?>

</body>
</html>
開發者ID:UnstoppableMomentum,項目名稱:synopsis-php,代碼行數:20,代碼來源:addcolumn.php


注:本文中的CRow::addColumn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。