揭秘10條PHP中用的mysql語句_PHP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:解析一個經(jīng)典的PHP顯示分頁程序發(fā)現(xiàn)一個很漂亮的 PHP 顯示分頁程序,顯示效果如下 ?php functionpage($page,$total,$phpfile,$pagesize=10,$pagelen=7){ $pagecode=’’;//定義變量,存放分頁生成的HTML $page=intval($page);//避免非數(shù)字頁碼 $total=intval($total);//保證總記錄數(shù)值類型
10條PHP中用的mysql語句| 顯示數(shù)據(jù)庫或表: show databases;//然后可以use database_name; show tables; 更改表名: alter table table_name rename new_t; 添加列 : alter table table_name add column c_n column attributes; 刪除列: alter table table_name drop column c_n; 創(chuàng)建索引: alter table c_table add index (c_n1,c_n2); alter table c_table add unique index_name(c_n); alter table c_table add primary key(sid); 刪除索引: alter table c_table drop index c_n1; 更改列信息: alter table t_table change c_1 c_1 varchar(200); alter table t_table modify 1 c_1 varchar(200); insert插入語句: insert into table_name (c_1,c_2) values (’x1’,1); update語句: update table_name set c_1 =1 where c_2=3; 刪除數(shù)據(jù)庫或者表: drop table table_name; drop database database_name;//使用mysql_drop_db()可以刪除的. |
分享:揭秘學(xué)習(xí)php的八個問題和解決方法問題1:環(huán)境搭配 php最經(jīng)典的組合當(dāng)然是LAMP(Linux+Apache+MySQL+PHP)了,不過我沒有條件和精力弄Linux所以用Windows2003代替Linux了,自己調(diào)試用,又不是做服務(wù)器,所以不要求性能足夠用了。 本身我的機器是Win2003+IIS+Framework環(huán)境能跑起來ASP和.net,并
相關(guān)PHP教程:
- 相關(guān)鏈接:
- 教程說明:
PHP教程-揭秘10條PHP中用的mysql語句
。