>데이터 베이스 >MySQL 튜토리얼 >Doctrine单表操作_MySQL

Doctrine单表操作_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB원래의
2016-06-01 13:50:57943검색

bitsCN.com

 1 //====================================================================往表中增加数据vote_answer为表名<br> 2 /*<br> 3     $ins_vote_answer = new voteAnswer();//往vote_answer表中插入数据<br> 4     $ins_vote_answer['id'] = 3;<br> 5     $ins_vote_answer['member_id'] = 1;<br> 6     $ins_vote_answer['vote_question_id'] = 1;<br> 7     $ins_vote_answer['vote_question_option_id'] = 1;<br> 8     $ins_vote_answer['body'] = 1;<br> 9     $ins_vote_answer['created_at'] = 1;<br>10     $ins_vote_answer['updated_at'] = 1;<br>11     $ins_vote_answer->save();<br>12 */<br>13 <br>14 //====================================================================查询数据<br>15 /*<br>16 //    $id = 1;<br>17 //    $member_id = 1;<br>18 //    $que_voteAnswer = Doctrine::getTable('voteAnswer')->createQuery()->select('id,member_id')->where('id=?',$id)->andWhere('member_id=?',$member_id)->orderBy('id')->groupBy('id');//====查询方法一表名vote_answer<br>19 //    $que_voteAnswer = Doctrine_Query::create()->select('id,member_id')->from('voteAnswer')->where('id = 2')->andWhere('member_id = 1')->orderBy('id')->groupBy('id');//====查询方法二<br>20 //    $row_voteAnswer = $que_voteAnswer->fetchOne();//不管执行几次此方法只获取结果集第一条记录<br>21 //    //$row_voteAnswers = $que_voteAnswer->execute();//和下面的fetchArray()方法基本等同,都需要沥遍<br>22 //    //$row_voteAnswers = $que_voteAnswer->fetchArray();<br>23 //    //foreach($row_voteAnswers as $row_voteAnswer){<br>24 //      $this->a = $row_voteAnswer['id'];<br>25 //    /
    
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.