0

Can I fetch data directly from a database using java-script.

Something like

var results = conn.query("select * from table");

then use in my html

document.innerHtml(results[0]['name']);
NoNaMe
  • 6,020
  • 30
  • 82
  • 110
Sahil Jain
  • 177
  • 2
  • 11

1 Answers1

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,

Community
  • 1
  • 1
filiprem
  • 6,721
  • 1
  • 29
  • 42