上传mysql表格,在CSV上传时自动构建mySql表

Automatically build mySql table upon a CSV file upload.

I have a admin section where admin can upload CSV files with different column count and different column name.

which it should then build a mySql table in the db which will read the first line and create the columns and then import the data accordingly.

I am aware of a similar issue, but this is different because of the following specs.

The name of the Table should be the name of the file (minus the extension [.csv])

each csv file can be diffrent

Should build a table with number of columns and names from the CSV file

add the the data from the second line and on

Maybe there are known frameworks that makes this easy.

Thanks.

解决方案

The second example should put you on the right track, there isn't some automatic way to do it so your going to need to do a lil programming but it shouldn't be too hard once you implement that code as a starting point.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值