Jump to content

Awards


Xtremer360

Recommended Posts

So inside my custom CMS i'm developing I have a module that controls various things like adding/editing awards, adding/editing award shows, and viewing voteCounts for the awardshows and for the individual nominees. Now the question I have is if there is a way without having to have the user make input to close the voting to have it actually close it by itself.

Link to comment
Share on other sites

Use timestamps!

 

If you want the vote to close in 30 days, simply have a close date stored in an sql database, or as a unix timestamp in a flat file.

 

Before someone can vote, check the current date, if it's AFTER the close date, don't allow it!

Link to comment
Share on other sites

Well I tried this and no matter what it puts the value into that dateExpires as 0000-00-00

 

$year = date('Y');       
        $query = "INSERT INTO `awardsShows` 
                (awardsDate, statusID, creatorID, dateCreated, dateExpires) 
            VALUES 
                ('".$date."','".$statusID."','".$userID."', NOW(), '".$year."'-12-31)";
        mysqli_query($dbc, $query);
        $result = "good";

Link to comment
Share on other sites

Try putting your date together before the query.

 

 

$year = date('Y');     

$year .= "-12-31";

 

        $query = "INSERT INTO `awardsShows`

                (awardsDate, statusID, creatorID, dateCreated, dateExpires)

            VALUES

                ('".$date."','".$statusID."','".$userID."', NOW(), '".$year."')";

        mysqli_query($dbc, $query);

        $result = "good";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.