本文整理汇总了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 ===";
示例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> ";
示例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>