diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-06-13 16:05:48 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-06-13 16:06:58 +0200 |
commit | bb353e8e61156b0c9fdab673e2485502a01b8434 (patch) | |
tree | 31297c950bbdc9df68c0fb5e0f5c8a8b3c5aba5b /includes/concertlogs.php | |
parent | 72340c709e50a2383a8c651d72bb4396e9477c9a (diff) | |
download | gigologadmin-bb353e8e61156b0c9fdab673e2485502a01b8434.tar.gz gigologadmin-bb353e8e61156b0c9fdab673e2485502a01b8434.tar.bz2 gigologadmin-bb353e8e61156b0c9fdab673e2485502a01b8434.zip |
Move method to update Concertlogs to Concertlogs class.
Diffstat (limited to 'includes/concertlogs.php')
-rw-r--r-- | includes/concertlogs.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/concertlogs.php b/includes/concertlogs.php index cd0a330..8b1ca63 100644 --- a/includes/concertlogs.php +++ b/includes/concertlogs.php @@ -36,6 +36,28 @@ if ( !class_exists( 'GiglogAdmin_Concertlogs' ) ) $wpdb->query($q); } + static function update($cid, $ph1, $ph2, $rev1, $rev2) + { + global $wpdb; + + $res = $wpdb->update('wpg_concertlogs', array( + 'wpgcl_photo1' => $ph1, + 'wpgcl_photo2' => $ph2, + 'wpgcl_rev1' => $rev1, + 'wpgcl_rev2' => $rev2 + ), + array('wpgcl_concertid' => $cid) + ); + + if ( !$res ) { + // exit( var_dump( $wpdb->last_query ) ); //for onscreen debugging when needed + error_log( __CLASS__ . '::' . __FUNCTION__ . ": {$wpdb->last_error}"); + die; + } + + return ($wpdb->last_error); + } + public static function get_status(int $concert_id) : ?int { global $wpdb; |