Skip to content

Instantly share code, notes, and snippets.

@nek023
Created August 15, 2013 14:33
Show Gist options
  • Save nek023/6241294 to your computer and use it in GitHub Desktop.
Save nek023/6241294 to your computer and use it in GitHub Desktop.
my $db = Intern::Diary::DBI::Factory->new;
my $dbh = $db->dbh('intern_diary');
my $sth = $dbh->prepare(q[
INSERT INTO entry
SET
user_id = ?,
title = ?,
content = ?,
draft = ?,
created = ?,
updated = ?
]);
$sth->execute(
$user->user_id,
$title,
$content,
$draft,
DateTime::Format::MySQL->format_datetime($created),
DateTime::Format::MySQL->format_datetime($updated),
);
my $entry_id = $sth->{mysql_insertid};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment