Fixed typo producing db error when message queued

$query = sprintf ("select * from %s where id=%d", $msgtble, $id);
Should be
$query = sprintf ("select * from %s where id=%d", $msgtbl, $id);