function getDetails($table, $data = '*', $cond = NULL, $list = FALSE, $exact = FALSE) { if (Main::$con == FALSE) { Main::openConnection(); $this->newCon = TRUE; } $data = Main::escape($data); $query = Main::generateQuery('SELECT', $data, $table, $cond); //echo $query; if ($query) { $result = mysql_query($query) or Main::throwException('Internal Error Occured', 0, 'Query Failed ' . $query . " " . mysql_error()); if (mysql_num_rows($result) > 0) { $data = array(); while ($row = mysql_fetch_assoc($result)) { if (!$list) { $data[] = $row; } else { foreach ($row as $key => $value) { $data[] = $value; } } } return $data; } else { return array(); } } else { echo "Query Not Found"; } }
function __construct($data, $table, $cond) { if (Main::$con == FALSE) { Main::openConnection(); $this->newCon = TRUE; } $data = Main::escape($data); $query = Main::generateQuery('UPDATE', $data, $table, $cond); mysql_query($query) or Main::throwException('Internal Error Occured', 0, 'Query Failed' . mysql_error()); //Main::displaySuccess('DataBase Updated Successfully'); }