websql
来源:互联网 发布:怎样降低淘宝纠纷率 编辑:程序博客网 时间:2024/05/29 08:26
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>sql</title>
</head>
<body>
<script>
var db=openDatabase("web001","1","humanmessage",1024*4);
function createSql () {
db.transaction(function (txobject) {
txobject.executeSql("create table if not exists avlon(name text,message text,time integer)",[],function () {
console.log("succes");
},function () {
console.log("faile");
})
})
}
createSql();
function insertSql (name,message,time) {
db.transaction(function(txobject){
txobject.executeSql("insert into avlon values(?,?,?)",[name,message,time],function () {
console.log("数据插入成功");
},function(){
console.log("数据插入失败");
})
})
}
function select (){
db.transaction(function(tx){
tx.executeSql("select * from avlon",[],function(tx,rs){
for (var i=0;i<rs.rows.length;i++) {
console.log(rs.rows.item(i).name)
}
},function(){
})
})
}
insertSql("wanzhuhao","feichangdiao",new Date().getTime());
insertSql("fnahuizhong","mywifi",new Date().getTime());
select();
</script>
</body>
</html>
0 0
- websql
- WebSQL
- websql
- websql
- webSQL
- html5 websql
- webSQL 操作
- html webSQL
- webSQL使用
- WebSQL查询www
- HTML5本地数据库(WebSQL)
- 前端存储之websql
- H5—websql
- H5 websql实例
- webSql简单探究
- 简单实现websql
- HTML5之WebSQL
- webSql基础用法
- MongoDB
- modelsim安装破解过程
- 如何用Github版本控制非Github库
- 【搜索】【CQBZOJ 2468】终极大水题(反素数)
- Spring3+Hibernate+Struts2整合之注解整合
- websql
- AndroidAnnotations标签
- 四元数与旋转
- Builder模式
- HDU 2007 平方和与立方和
- oracle中给表和列起别名
- sessionStorage localStorage
- 最好用的Unity版本控制工具
- 职场菜鸟感悟