Exemplo n.º 1
0
function DbSetVote($movie_name, $vote_value)
{
    if ($vote_value < 0) {
        return;
    }
    if ($vote_value > 5) {
        return;
    }
    // welke movie en user id?
    $movie_id = DbGetMovieId($movie_name);
    $user = DbGetCurrentUser();
    $vote[movie_id] = $movie_id;
    $vote[user_id] = $user[user_id];
    $vote[vote_value] = $vote_value;
    // bestaande vote weghalen
    db_DoQuery("\n\t    DELETE \n\t    FROM votes\n\t    WHERE user_id='{$vote['user_id']}'\n\t    AND\tmovie_id='{$vote['movie_id']}'\n\t");
    // noaie toevoegn
    db_SetRow("votes", 0, $vote);
}
Exemplo n.º 2
0
function _config_Set($key, $value)
{
    db_Connect();
    return db_DoQuery("INSERT " . CMW_TABLE_CONFIG . " (\n\t\t\t`key`, `value`, `timestamp`\n\t\t)\n\t\tVALUES ( \n\t\t\t?, ?, NOW()\n\t\t);", $key, $value);
}