Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. try {
  2.     $connection = new PDO("mysql:host=localhost;dbname=zuperdb", "root", "kissa2");
  3. } catch(PDOException $exc){
  4.     die($exc->getMessage());
  5. }
  6. $query = $connection->prepare("INSERT INTO blog (author, title, content, timestamp, keywords) VALUES (id, :author, :title, :content, NOW(), :keywords)");
  7. $query->bind_param(":author", $author, PDO::PARAM_STR, 30);
  8. $query->bind_param(":title", $title, PDO::PARAM_STR, 50);
  9. $query->bind_param(":content", $content, PDO::PARAM_STR, 9000);
  10. $query->bind_param(":keywords", $keywords, PDO::PARAM_STR, 200);
  11. $query->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement