//Insert Data Into Multiple Columns
//$params= Array Value array('me_title' => $_POST['me_title'])
function insertData($table, $params)
{
global $db;
$columns = array_keys($params);
$values = array_values($params);
$sql = "INSERT INTO $table (" . implode(',', $columns) . ") VALUES ('" . implode("', '", $values) . "' )";
$result = $db->query($sql);
$insertId = $db->getInsertId();
if ($result) {
return $insertId;
} else {
return false;
}
}