PHP - $where - Approval
hi
I have one problem with this script. I want that he the videos when status = active but i don'T know how i should write this in the $where. I mean take video WHERE status = ACTIVE. Maybe someone can help me, it's will be great! Thanks a lot ;-) Hier is the script: static function count($table, $where = '', $order = '', $limit = '', $group = '') { $sql = 'SELECT COUNT(*) '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::result($sql); } static function field($table, $field, $where = '', $order = '', $limit = '', $group = '') { $sql = 'SELECT `' . $field . '` '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::column($sql); } static function select($table, $where = '', $order = '', $limit = '', $fields = '*', $group = '') { $sql = 'SELECT ' . (is_array($fields) ? '`' . implode('`,`', $fields) . '`' : $fields) . ' '; $sql .= 'FROM `' . $table . '` '; $sql .= ($where == '' ? '' : 'WHERE ' . $where . ' '); $sql .= ($order == '' ? '' : 'ORDER BY ' . $order . ' '); $sql .= ($group == '' ? '' : 'GROUP BY ' . $group . ' '); $sql .= ($limit == '' ? '' : 'LIMIT ' . $limit . ' '); return DB::all($sql); } Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313317.0 i want the code for review approval platform (costumer reviews for a product )and in backend editing the code and updating it |