使用javascript将查询插入mysql [英] insert query into mysql using javascript

查看:67
本文介绍了使用javascript将查询插入mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想使用javascript将记录插入到我的mysql数据库中.例如,如果我在URL中提供www.google.com,我想将google和www.google.com存储到mysqldb中.请帮助javascript分割单词并插入db.

谢谢

hello,

I want to insert record into my mysql db using javascript. for example if i give www.google.com in url i want to store google and www.google.com into mysqldb. Please help javascript to split word and also insert into db.

Thanks

推荐答案

JavaScript与MySql没有任何联系,也不应该有.这样做将允许任何站点访问本地MySql实例,因为javascript是在客户端而不是服务器上运行的.这将是一个坏主意,因为它将为任何网站提供可用的执行路径.不好!<​​br/>
在服务器上的代码隐藏区中访问数据库,您无法在客户端上进行.
Javascript has no connection to MySql, nor should there ever be. To do so would allow any site access to your local MySql instance, since javascript is run on the Client, not the Server. This would be a bad idea, as it would provide an execution path available to any website. Not good!

Access the database in the codebehind on the server, you can''t do it on the client.


这篇关于使用javascript将查询插入mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆