This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function addToCart(orderid) { | |
let sql = `CALL add_to_cart(?);`; | |
let res2; | |
res2 = await db.query(sql, [orderid]); | |
console.log("addtocart", res2); | |
console.info(`SQL: ${sql} got ${res2.length} rows.`); | |
return res2[0]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function nyLon(akronym, lon) { | |
const db = await mysql.createConnection(config); | |
let sql; | |
let res; | |
let str; | |
let akr1 = `${akronym}`; | |
let lon1 = `${lon}`; | |
console.info("") | |
sql = ` | |
UPDATE larare SET lon = (lon1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
får följande fel: | |
MariaDB [skolan]> source ddl_all.sql | |
Query OK, 0 rows affected (0.00 sec) | |
Query OK, 0 rows affected (0.02 sec) | |
Query OK, 0 rows affected, 1 warning (0.00 sec) | |
Query OK, 0 rows affected, 1 warning (0.00 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Utan: const mysql = require("promise-mysql"); | |
const config = require("./config.json"); i början av teachers.js ger felet: | |
anders@andershpjobb ~/BTH/Dbwebbkurser/databas/me/kmom02/search $ node teachers.js | |
(node:13696) UnhandledPromiseRejectionWarning: ReferenceError: mysql is not defined | |
at /home/anders/BTH/Dbwebbkurser/databas/me/kmom02/search/teachers.js:11:16 | |
at Object.<anonymous> (/home/anders/BTH/Dbwebbkurser/databas/me/kmom02/search/teachers.js:59:3) | |
at Module._compile (module.js:652:30) | |
at Object.Module._extensions..js (module.js:663:10) | |
at Module.load (module.js:565:32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anders@andershpjobb ~/BTH/Dbwebbkurser/databas/me $ dbwebb update | |
Update course-repo with latest changes from its master at GitHub. | |
remote: Enumerating objects: 50, done. | |
remote: Counting objects: 100% (50/50), done. | |
remote: Compressing objects: 100% (19/19), done. | |
remote: Total 38 (delta 22), reused 34 (delta 19), pack-reused 0 | |
Unpacking objects: 100% (38/38), done. | |
From https://github.com/dbwebb-se/databas | |
38d97ae..9ffd048 master -> origin/master | |
Updating 38d97ae..9ffd048 |