Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public function insetData($menus){
  2.  
  3. $config = new ConfigSettings();
  4.  
  5. DB::init($config->db['host'], $config->db['username'], $config->db['password'], $config->db['database']);
  6.  
  7.  
  8.  
  9.  
  10.  
  11. $result = DB::query("SELECT * FROM vu67t_assets ORDER BY id DESC LIMIT 1");
  12.  
  13.  
  14.  
  15.  
  16. $asset_id = $result[0]['id'] + 1;
  17.  
  18.  
  19.  
  20.  
  21. $title = "test";
  22. $alis = "test";
  23. $state = "1";
  24. $catid = "2";
  25.  
  26.  
  27. $introtext = '<p>This is some Content</p>';
  28.  
  29.  
  30. $insertArticle = DB::query("INSERT INTO vu67t_content (asset_id, title, alis, state, catid, introtext) VALUES ( ?. ?, ?, ?, ?, ?)", array($asset_id, $title, $alis, $state, $catid, $introtext));
  31.  
  32. if(!$insertArticle) {
  33. echo 'Database Error: '.DB::getError();
  34. }else{
  35.  
  36. echo "inserted?";
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement