if($count === 0){
$db->exec('INSERT INTO 'records' ('name', 'tel', 'vremya') VALUE('$name', '$tel', '$date')");
$result = true;
$msg = "ok";
var mysql = require('mysql');
var connection = mysql.createConnection(
{
host : 'localhost',
user : 'your-username',
password : 'your-password',
database : 'wordpress',
}
);
connection.connect();
var query = connection.query('SELECT * FROM wp_posts');
query.on('error', function(err) {
throw err;
});
query.on('fields', function(fields) {
console.log(fields);
});
query.on('result', function(row) {
console.log(row.post_title);
});
connection.end();