直接从javascript查询数据库

时间:2015-06-30 09:40:25

标签: javascript sql database

我可以使用java脚本直接从数据库中获取数据。

这样的东西
var results = conn.query("select * from table");

然后在我的html中使用

document.innerHtml(results[0]['name']);

1 个答案:

答案 0 :(得分:0)

YES. You can do it - you can query some database engines directly from Javascript. But you almost never do it, because in AJAX model you have thin clients with no fast access to database engine.

See: this answer to another question,