Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($query){
- echo 'executed';
- }
- else {
- echo 'error';
- }
- public static function updateItem($slug, $title, $description, $thumbnail, $preview, $main_file, $screenshot, $category, $amount, $review, $demo_url, $tags, $live, $video, $apc) {
- $db = new Database;
- $main_category = Login::encrypt_decrypt("decrypt", $apc);
- $sub_category = Login::encrypt_decrypt("decrypt", $category);
- $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']);
- if($q){
- echo 'good'; exit;
- }
- else {
- echo 'wrong'; exit;
- }
- }
- public function __construct($username = "root", $password = "", $host = "localhost", $dbname = "market", $options = []) {
- $this->isConn = TRUE;
- try {
- $this->datab = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password, $options);
- $this->datab->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $this->datab->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
- } catch (PDOException $e) {
- throw new Exception($e->getMessage());
- }
- }
- public function updateRow($query, $params = []) {
- $this->insertRow($query, $params);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement