-
-
Save murindwaz/6190856 to your computer and use it in GitHub Desktop.
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
var mysql = require('mysql'); | |
var client = mysql.createConnection({ | |
host: 'localhost', | |
user: 'omeka', | |
password: 'omeka', | |
port: 8889, | |
database: 'neatline' | |
}); | |
client.connect(); | |
// Create exhibit. | |
var sql = 'INSERT INTO exhibits (title) VALUES ("dev")'; | |
client.query(sql, function(err, res) { | |
// Create row, using the insert id of the first query | |
// as the exhibit_id foreign key. | |
sql = 'INSERT INTO records (exhibit_id) '+ | |
'VALUES('+res.insertId+')'; | |
client.query(sql); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment