getMessage(); } function get_images($pdo, $search='%', $sort='img_date', $sdir='DESC') { if ($sort != 'img_date' && $sdir != 'ASC') { if ($sort != 'img_title' && $sdir != 'DESC') { echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir); die(); } } $params = array('search' => $search); $stmt = $pdo->prepare("SELECT * FROM images WHERE img_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;"); $stmt->execute($params); // $stmt->debugDumpParams(); $data = $stmt->fetchAll(); $img_list = ''; echo $img_list; } function get_audio($pdo, $search='%', $sort='aud_date', $sdir='DESC') { if ($sort != 'aud_date' && $sdir != 'ASC') { if ($sort != 'aud_title' && $sdir != 'DESC') { echo('Ey boss, database request is kinda f*cked up. Maybe you want to try that again, hey...
'.$sort.' '.$sdir); die(); } } $params = array('search' => $search); $stmt = $pdo->prepare("SELECT * FROM audio WHERE aud_title LIKE CONCAT('%', :search ,'%') ORDER BY $sort $sdir;"); $stmt->execute($params); // $stmt->debugDumpParams(); $data = $stmt->fetchAll(); $aud_list = ''; echo $aud_list; }