Example of using Web SQL in HTML 5: websql
Web SQL simulates databases in a browser and can use JS to operate SQL to read and write data. However, this feature currently does not support many browsers, and its W3C specification has been discontinued, it seems that its prospects are not very clear.
W3C specification: http://www.w3.org/TR/webdatabase/#dom-sqltransaction-sync-executesql)
Supported browsers and versions:
Safari (3.2 +)
Chrome (3.0 +)
Opera (10.5 +)
Generally, offline applications use webstorage, but webstorage has many limitations, such as storage space and domain security mechanisms. web SQL has no restrictions, it has a larger storage space (customizable), cross-origin read/write, free storage structure, and other features. It is also very convenient to use SQL for read/write.
Sample Code
<Span style = "font-family: System; font-size: 18px;"> <! DOCTYPE html>
For websql, due to the broad read/write rules, it brings about a lot of security issues. Cross-origin reading, XSS attacks, SQL injection, and so on are all very headaches. Therefore, consider carefully what data can be stored and how it is stored. W3C has stopped the update of this specification and may not be satisfied with the current specification design. Currently, browser vendors do not have a high level of support. The future development is still unknown.
Can I use HTML5 and SQL databases to implement a WEB-based Student Achievement Management System?
HTML is equivalent to the static Web page syntax. It can implement the page text and input functions. The background needs the support of Java, VBScript, and other programs. There are a lot of content in this aspect, we recommend that you search for related technologies by keywords such as ASP, Java, VBScript, and database links.
Html5 web SQL cannot delete records
Var SQL = "DELETE FROM StuInfo WHERE StuID =? "; Here is an error. Generally, var SQL =" DELETE FROM StuInfo WHERE StuID = ''+ [id] + ";