Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as PHP by Largo-W ( 15 years ago )
/* Hope this to update zenPhoto.
   * I use to change strings to array and in SQL Query change to IN struct.
   */
  $sql = array();
  unset($_POST['publish_albums']);
  foreach ($_POST as $key=>$albumid) {
   $albumid = sanitize_numeric($albumid);
   $sql[] = $albumid;
  }
  if (count($sql)) {
   $sql = 'UPDATE '.prefix('albums').' SET `show`="1" WHERE id IN( '.implode( ',', $sql ).' )';
   query($sql);
  }

 

Revise this Paste

Your Name: Code Language: