Advertisement
Guest User

Untitled

a guest
Mar 6th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. if($query){
  2. echo 'executed';
  3. }
  4. else {
  5. echo 'error';
  6. }
  7.  
  8. public static function updateItem($slug, $title, $description, $thumbnail, $preview, $main_file, $screenshot, $category, $amount, $review, $demo_url, $tags, $live, $video, $apc) {
  9. $db = new Database;
  10. $main_category = Login::encrypt_decrypt("decrypt", $apc);
  11. $sub_category = Login::encrypt_decrypt("decrypt", $category);
  12. $q = $db->updateRow("UPDATE items SET name = ?, description = ?, thumbnail = ?, main_file = ?, categories = ?, sub_category = ?, demo_url = ?, slug = ?, price = ?, reviewer_comment = ?, datetime = ?, status = ?, video_file = ?, item_tags_string = ?, preview_file = ?, screenshot_file = ?, live_file = ? WHERE user_id = ? AND temp_files != '' AND temp_file_real != '' AND status = ?", [$title, $description, $thumbnail, $main_file, $main_category, $sub_category, $demo_url, $slug, $amount, $review, Item::nowTime(), 'queue', $video, $tags, $preview, $screenshot, $live, Profile::getid(), 'temp']);
  13. if($q){
  14. echo 'good'; exit;
  15. }
  16. else {
  17. echo 'wrong'; exit;
  18. }
  19. }
  20.  
  21. public function __construct($username = "root", $password = "", $host = "localhost", $dbname = "market", $options = []) {
  22. $this->isConn = TRUE;
  23. try {
  24. $this->datab = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password, $options);
  25. $this->datab->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  26. $this->datab->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
  27. } catch (PDOException $e) {
  28. throw new Exception($e->getMessage());
  29. }
  30. }
  31.  
  32. public function updateRow($query, $params = []) {
  33. $this->insertRow($query, $params);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement