Jump to content
Dinocanid

Cron won't add new rows (plus another new issue)

Recommended Posts

I'm trying to add a cron that automatically creates a new show every 5 hours. After spending forever debugging, the cron no longer throws any errors when ran. However, it doesn't actually do anything.

 

$loop = $this->DB->query(
            "SELECT
                `event_types`.`id`,
                `event_types`.`species`
            FROM
                `event_types`"
        );
        
        while ($event = $this->DB->fetch($loop)) {
            $eventID = $event['id'];
            $species = $event['species'];
            $this->DB->query(
                "INSERT INTO
                    `shows`
                (
                    `player_id`,
                    `event_id`,
                    `event_type`,
                    `entry_fee`,
                    `created`,
                    `prize`,
                    `species`
                )
                VALUES
                (
                    101,
                    1,
                    '$eventID',
                    0,
                    CURRENT_TIMESTAMP,
                    100,
                    '$species'
                )"
            );
        }

It's just a short and simple insert query, but the cron won't add any rows when ran.

Edited by Dinocanid

Share this post


Link to post
Share on other sites

Ok so uhhh, this new thing is unrelated to the original question but somehow the game screwed itself today. I'm getting this after logging in:

Quote

Fatal error: Cannot unset $this in /home/dreamwater/public_html/caniquusnew/src/PetGameFramework/User/Player.php on line 1272

Despite me not touching the player class or any login files at all. In fact, I hadn't touched any files in almost 2 days. This is the code it's referring to:

    public function logout()
    {
        $this->DB->query(
            "UPDATE
                `" . $this->table . "`
            SET
                `atime` = NOW()
            WHERE
                `id` = '$this->id'"
        );

        //make sure the object is destroyed even if the session isn't removed
        unset($this);
        session_destroy();
    }

 

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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

By using this site, you agree to our Guidelines, Terms of Use, and Privacy Policy.