我先抛块砖,虽然破点,希望有点响。
1.保证MySQL 和 apache 能运行
2.通过phpMyAdmin 建立一个数据库dbtest. 和一个表 part (字段 partnumber, desc ,memo)
3.打开Delphi for php 新建一个application. 通过 Data Explorer 连接数据库dbtest 并展开到表.
4.将part表拖到 form 中。添加Edit1,Edit2,Memo1. ok 了 开始写传统的fieldbyname代码。呵呵
浏览
第一条:
$this->tbpart1->First();
$this->Edit1->Text = $this->tbpart1->Fields['partnumber'];
$this->Edit2->Text = $this->tbpart1->Fields['desc'];
$this->Memo1->Text = $this->tbpart1->Fields['memo'];
上一条:
$this->tbpart1->Prior();
.....
下一条:
$this->tbpart1->Next();
......
最后一条:
$this->tbpart1->Last();
......
添加一条:
$this->tbpart1->Insert();
$this->tbpart1->Fields['partnumber'] = $this->Edit1->Text;
$this->tbpart1->Fields['desc'] = $this->Edit2->Text;
$this->tbpart1->Fields['memo'] = $this->Memo1->Text;
$this->tbpart1->Post();
删除:
$this->tbpart1->Delete();
运行看看吧.