Closed thearabbit closed 9 years ago
I am newbie for Dart and SqlJocky. I try like this:
<body> <h1>MySQL</h1> <div class="widgets"> <div> <button id="testButton">Test</button> </div> </div> <script type="application/dart" src="piratebadge.dart"></script> <script src="packages/browser/dart.js"></script> </body>
import 'dart:html'; import 'package:sqljocky/sqljocky.dart'; ButtonElement testButton; void main() { testButton = querySelector('#testButton'); testButton.onClick.listen(testMysql); } void testMysql(Event e) { var pool = new ConnectionPool(host: '127.0.0.1', port: 3306, user: 'root', password: '123456', db: 'mydb', max: 5); pool.query('select name, email from users').then((results) { results.forEach((row) { print('Name: ${row.name}, email: ${row.email}'); }); }); }
it show error: Uncaught Unsupported operation: RawSocket constructor on brower console.
Uncaught Unsupported operation: RawSocket constructor
SQLjocky will only work in the command-line VM, not in a browser.
so, could i get the data from db and view it on browser like alert()?
alert()
I am newbie for Dart and SqlJocky. I try like this:
it show error:
Uncaught Unsupported operation: RawSocket constructor
on brower console.