本文介绍了带有SQL数据库的HTML5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HTML5制作这个SQL数据库代码在这里

<!DOCTYPE HTML>

< html>

< ; head>

< script>

var db = openDatabase('mydb','1.0','Test DB',2 * 1024 * 1024);

var msg;

db.transaction(function(tx){

tx.executeSql('CREATE TABLE IF NOT NOT EXISTS LOGS(id unique,log )');

tx.executeSql('INSERT INTO LOGS(id,log)VALUES(1,foobar)');

tx.executeSql('INSERT INTO LOGS(id,log)VALUES(2,logmsg)');

msg ='

创建日志消息并插入行。

I am making this SQL database using HTML5 the code is here
<!DOCTYPE HTML>
<html>
<head>
<script>
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
var msg;
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, "logmsg")');
msg = '

Log message created and row inserted.

找到行:+ len +

Found rows: " + len + "

+ results.rows.item(i).log +

状态消息



< / body>

< / html>







此代码将输入的信息添加到我的数据库中

tx.executeSql('INSERT INTO LOGS( id,log)VALUES(1,foobar)');

tx.executeSql('INSERT INTO LOGS(id,log)VALUES(2,logmsg)');





但是,我希望我的用户在文本框中输入他们的信息,然后保存到我的数据库中



请帮助

谢谢


</body>
</html>



This codes adds the information in enter to my databse
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, "foobar")');
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, "logmsg")');


But instead of this, i want my user to enter their information in a textbox which then saves to my database

Please help
Thanks

推荐答案


这篇关于带有SQL数据库的HTML5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 20:00