日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

php txtsql 说明,PHP学习笔记(2)txtSQL文档错误

發布時間:2025/3/12 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php txtsql 说明,PHP学习笔记(2)txtSQL文档错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

PHP學習筆記(2)txtSQL文檔錯誤

次閱讀

在使用txtSQL的過程中,發現一處幫助文檔錯誤。

在使用altertable命令改變表名稱時,發現如果按照幫助文檔所說,使用如下代碼無法改變表的名稱:

$sql->altertable(array('db'=>$db_name,'table'=>$table_name,'name'=>$table_name,'action'=>'rename table','value'=>array('name'=>$table_rename_name))

后來查閱范例程序,才發現如果修改表名必須使用如下代碼才可以,也就是說,第三個參數“name”的值應該是新的表名。不需要設定第五個參數“value”:

$sql->altertable(array('db'=>$db_name,'table'=>$table_name,'name'=>$table_rename_name,'action'=>'rename table')

以下是幫助文檔中的描述:

altertable

Purpose: To alter a txtSQL-table's column definitions txtSQL >= 2.2.2 RC2

void altertable ( array ('table' => $table, 'action' => $action, 'name' => $column, 'values' => $values [, 'after' => $afterColumn [, 'db' => $db]]) )

This function will alter a txtSQL-$table's column defintions. It will only work with the specified column, which is $column. The $action can be either

insert- Inserts a new column, $column, and if specified, after the column $afterColumn

modify- Modifies an existing $column

drop- Drops an existing $column

rename col- Renames a $column. Expects array('name' => $newcolname) in the $values

//此句錯誤

rename table- Renames a $table. Expects array('name' => $newTableName) in the $values

addkey- Sets $column as the primary key ( must be integer and auto_increment ). Expects array('name' => $colName) in the $values

dropkey- Does opposite of 'addkey'

The $values element is an array containing information about the column, it must be in the following format

array( [$colType => $value]... ) unless otherwise noted above

總結

以上是生活随笔為你收集整理的php txtsql 说明,PHP学习笔记(2)txtSQL文档错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。