drupal-6.comments.database.php 747 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. db_update('node')->fields(array(
  3. 'comment' => 2
  4. ))
  5. ->condition('nid', 1)
  6. ->execute();
  7. db_insert('comments')->fields(array(
  8. 'cid',
  9. 'pid',
  10. 'nid',
  11. 'uid',
  12. 'subject',
  13. 'comment',
  14. 'hostname',
  15. 'timestamp',
  16. 'status',
  17. 'format',
  18. 'thread',
  19. 'name',
  20. 'mail',
  21. 'homepage',
  22. ))
  23. ->values(array(
  24. 'cid' => 1,
  25. 'pid' => 0,
  26. 'nid' => 1,
  27. 'uid' => 3,
  28. 'subject' => 'Comment title 1',
  29. 'comment' => 'Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1',
  30. 'hostname' => '127.0.0.1',
  31. 'timestamp' => 1008617630,
  32. 'status' => 0,
  33. 'format' => 1,
  34. 'thread' => '01/',
  35. 'name' => NULL,
  36. 'mail' => NULL,
  37. 'homepage' => '',
  38. ))
  39. ->execute();