freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)庫操作-資料下載頁

2024-11-16 22:31本頁面
  

【正文】 ′)。$selectjoin(‘m_type’, ‘ = ’, ‘type_name’)。//多表聯(lián)合查詢$videoArray = $dbfetchAll($select,$params)。find()方法,可以使用主鍵值在表中檢索數(shù)據(jù).// SELECT * FROM round_table WHERE id = “1″ $row = $tablefind(1)。// SELECT * FROM round_table WHERE id IN(“1″, “2″, 3″)$rowset = $tablefind(array(1, 2, 3))。(2)數(shù)據(jù)刪除總結(jié)第一種方法:可以刪任意表//quoteInto($text, $value, $type = null, $count = null)$table = ‘m_video’。// 設(shè)定需要刪除數(shù)據(jù)的表 $db = $thisgetAdapter()。$where = $dbquoteInto(‘name = ?’, ‘ccc’)。// 刪除數(shù)據(jù)的where條件語句 echo $rows_affected = $dbdelete($table, $where)。// 刪除數(shù)據(jù)并得到影響的行數(shù) 第二種方法:只能刪除本表中的 //delete用法// delete($where)$where = “name = ‘bbb’”。echo $thisdelete($where)。// 刪除數(shù)據(jù)并得到影響的行數(shù)(3)數(shù)據(jù)更新總結(jié)第一種方法:可以更新任意表// 以”列名”=”數(shù)據(jù)”的格式構(gòu)造更新數(shù)組,更新數(shù)據(jù)行 $table = ‘m_video’。// 更新的數(shù)據(jù)表 $db = $thisgetAdapter()。$set = array(‘name’ = ‘蝶影重重’, ‘clicks’ = ’888′,)。$where = $dbquoteInto(‘id = ?’, ’10′)。// where語句 // 更新表數(shù)據(jù),返回更新的行數(shù)echo $rows_affected = $dbupdate($table, $set, $where)。第二種方法:只能更新本表中的 $set = array(‘name’ = ‘蝶影重重22′, ‘clicks’ = ’8880′,)。$db = $thisgetAdapter()。$where = $dbquoteInto(‘id = ?’, ’10′)。// where語句$rows_affected = $thisupdate($set, $where)。// 更新表數(shù)據(jù),返回更新的行數(shù)(4)數(shù)據(jù)插入總結(jié)第一種方法:可以在任意表中插入數(shù)據(jù)$table = ‘m_gao’。// 插入數(shù)據(jù)的數(shù)據(jù)表 $db = $thisgetAdapter()。// 以”列名”=”數(shù)據(jù)”的格式格式構(gòu)造插入數(shù)組,插入數(shù)據(jù)行 $row = array(‘title’ = ‘大家好。111′, ‘content’ = ‘影視網(wǎng)要改成用zend framework開發(fā)啊’, ‘time’ = ’20090504 17:23:36′,)。// 插入數(shù)據(jù)行并返回插入的行數(shù)$rows_affected = $dbinsert($table, $row)。// 最后插入的數(shù)據(jù)id echo $last_insert_id = $dblastInsertId()。$row=array(‘name’=’curdate()’, ‘a(chǎn)ddress’ = new Zend_Db_Expr(‘curdate()’))這樣子字段name會插入一個curdate()的字符串,而address插入一個時間值(curdate()的結(jié)果20090509)第二種方法:只能適合本表中的還沒有總結(jié)出來(5)事務(wù)處理$table = ‘m_gao’。// 插入數(shù)據(jù)的數(shù)據(jù)表 $db = $thisgetAdapter()。$dbbeginTransaction()。//Zend_Db_Adapter會回到自動mit模式下,直到你再次調(diào)用 beginTransaction()方法// 以”列名”=”數(shù)據(jù)”的格式格式構(gòu)造插入數(shù)組,插入數(shù)據(jù)行 $row = array(‘id’=null, ‘title’ = ‘大家好。111′, ‘content’ = ‘影視網(wǎng)要改成用zend framework開發(fā)啊’, ‘time’ = ’20090504 17:23:36′,)。try { // 插入數(shù)據(jù)行并返回插入的行數(shù)$rows_affected = $dbinsert($table, $row)。// 最后插入的數(shù)據(jù)id $last_insert_id = $dblastInsertId()。$dbmit()。// 事務(wù)提交 }catch(Exception $e){ $dbrollBack()。echo ‘捕獲異常:’.$egetMessage()。//打出異常信息 } echo $last_insert_id。(5)其他$db = $thisgetAdapter()。$tables = $dblistTables()。//列出當(dāng)前數(shù)據(jù)庫中的所有表$fields = $dbdescribeTable(‘m_video’)。//列出一個表的字段情況 ======使用Zend_Db_Select方法是一種不受數(shù)據(jù)庫約束構(gòu)建select的sql語句的工具(ares注:用戶可以使用該方法生成查詢的sql語句,而不需要考慮各種數(shù)據(jù) 庫sql語句的差別)。雖然該方法明顯還不完善,但是的確為我們提供一種方 法,幫助我們在不同的后臺數(shù)據(jù)庫進行相同的查詢工作。除此之外,它還可 以避免sql語句攻擊。這種方法可以去相關(guān)頁面查閱。
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1