如何使用 javascript 或 jquery 将 html 表单数据保存到 sql db
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23758972/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to save html form data to sql db using javascript or jquery
提问by user3564495
I'm new to this and haven't saved html form data so far. Can someone please guide about how to save the html form elements like first name, last name, password, email to sql database using javascript or jquery?
我是新手,到目前为止还没有保存 html 表单数据。有人可以指导如何使用 javascript 或 jquery 将 html 表单元素(如名字、姓氏、密码、电子邮件)保存到 sql 数据库?
回答by Danielle
This can't be done directly. JS is executed by the client browser, and need a middleware to allow saving the data in a MySQL DB.
这不能直接完成。JS 由客户端浏览器执行,需要一个中间件来允许将数据保存在 MySQL 数据库中。
Here is a linkto a tutorial on how to save data to a MySQL DB