如何用最簡單的語句提交大量表單物件的值儲存到資料庫
如何用最簡單的語句提交大量表單物件的值儲存到資料庫?說道這個問題可能大家經常遇到,感到很頭痛,但是又沒辦法,只能慢慢寫,筆者以提交一張應聘表單的提交為例給大家介紹如何用最簡短的語句來達到目的
指令碼執行通過環境環境:
iis5.0+sqlserver2000(當然也可以access2000等)
如有任何問題或建議請發email:[email protected]
生成表結構的指令碼
if exists (select * from dbo.sysobjects where id = object_id(n'[dbo].[yingpin]') and objectproperty(id, n'isusertable') = 1)
drop table [dbo].[yingpin]
gocreate table [dbo].[yingpin] (
[id] [int] identity (1, 1) not null ,
[yp_ name] [varchar] (20) collate chinese_prc_ci_as null ,
[***] [varchar] (4) collate chinese_prc_ci_as null ,
[birthday] [varchar] (15) collate chinese_prc_ci_as null ,
[health] [varchar] (10) collate chinese_prc_ci_as null ,
[hunyin] [varchar] (10) collate chinese_prc_ci_as null ,
[zhengzhi] [varchar] (10) collate chinese_prc_ci_as null ,
[xueli] [varchar] (10) collate chinese_prc_ci_as null ,
[zhicheng] [varchar] (10) collate chinese_prc_ci_as null ,
[english] [varchar] (10) collate chinese_prc_ci_as null ,
[email] [varchar] (50) collate chinese_prc_ci_as null ,
[phone] [varchar] (50) collate chinese_prc_ci_as null ,
[yp_ address] [varchar] (100) collate chinese_prc_ci_as null ,
[zip] [varchar] (10) collate chinese_prc_ci_as null ,
[colledge] [varchar] (50) collate chinese_prc_ci_as null ,
[zhuanye] [varchar] (50) collate chinese_prc_ci_as null ,
[bumen] [varchar] (50) collate chinese_prc_ci_as null ,
[gangwei1] [varchar] (50) collate chinese_prc_ci_as null ,
[gangwei2] [varchar] (50) collate chinese_prc_ci_as null ,
[x_shijian] [varchar] (500) collate chinese_prc_ci_as null ,
[x_address] [varchar] (500) collate chinese_prc_ci_as null ,
[x_zhiwu] [varchar] (500) collate chinese_prc_ci_as null ,
[g_shijian] [varchar] (500) collate chinese_prc_ci_as null ,
[g_address] [varchar] (500) collate chinese_prc_ci_as null ,
[g_zhiwu] [varchar] (500) collate chinese_prc_ci_as null ,
[h_name] [varchar] (500) collate chinese_prc_ci_as null ,
[h_guanxi] [varchar] (500) collate chinese_prc_ci_as null ,
[h_danwei] [varchar] (500) collate chinese_prc_ci_as null ,
[h_zhiwu] [varchar] (500) collate chinese_prc_ci_as null ,
[pingjia] [varchar] (500) collate chinese_prc_ci_as null ,
[shexiang] [varchar] (500) collate chinese_prc_ci_as null ,
[beizhu] [varchar] (500) collate chinese_prc_ci_as null ,
[shijian] [varchar] (50) collate chinese_prc_ci_as null
) on [primary]
goalter table [dbo].[yingpin] with nocheck add
constraint [df_yingpin_shijian] default (getdate()) for [shijian],
constraint [pk_yingpin] primary key clustered
( [id]
) on [primary]
goasp指令碼addyp.asp
<%
if request("action")="add" then
dim str,strvalue,strname,i,str1
str="yp_name,***,birthday,health,hunyin,zhengzhi,xueli,zhicheng,english,email,phone,yp_address,zip,colledge,zhuanye,bumen,gangwei1,gangwei2,x_shijian,x_address,x_zhiwu,g_shijian,g_address,g_zhiwu,h_name,h_guanxi,h_danwei,h_zhiwu,pingjia,shexiang,beizhu"
str1="x_shijian,x_address,x_zhiwu,g_shijian,g_address,g_zhiwu,h_name,h_guanxi,h_danwei,h_zhiwu"
strname=split(str,",")
for i=lbound(strname) to ubound(strname)
if i<>ubound(strname) then
if instr(str1,strname(i))=0 then
if trim(request.form(strname(i)))="" then
response.write ""
response.end()
end if
sql=sql&"'"&trim(request.form(strname(i)))&"',"
else
j=1
much=trim(request.form(cstr(strname(i)&j)))
for j=2 to 5
much
%>
git如何提交大於100M的檔案
git,作為現在主流的檔案伺服器,應用也越來越廣泛。git lfs install然後需要把超過大於100m的檔案加入track.git lfs track 檔名或者檔案字尾 然後新增.gitattributes檔案,通過上面的track都會加入到.gitattributes裡面。git add g...
sqlite3最簡單的SQL語句
1 建立資料庫檔案 touch 資料庫檔名.db 2 進入資料庫操作環境 sqlite3 資料庫名.db 3 建立表單 create table 表單名 列名 列名型別 primary key 列名 列名型別 primary key 4 刪除表單 drop table 表單名 5 修改表單名 alt...
如何用ajax提交核取方塊的值到後台
下面我們就結合具體的示例為大家介紹用ajax提交核取方塊的值到後台的方法。前端 如下 title 注 type表示的是提交的型別,這裡以post方式提交 url表示要將資料提交到的位置,這裡是form.php data表示提交的資料 值 後端 form.php如下 當我們選中選項點選提交時,前台的資...