3
Jump to content
  • 0

Saya punya pertanyaan tentang tugas yang dijadwalkan


Robot

Question

halo saya menetapkan tugas untuk menghapus sesi dan berhasil, dan ini adalah kode di file php

<?php
/**
 * MyBB 1.8
 * Copyright 2014 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/about/license
 *
 */
function task_clearsessions($task)
{
	global $mybb, $db, $cache, $lang, $plugins;
    $timeHours = 3;
    $cutoff = TIME_NOW - ($timeHours * 3600);
    $db->delete_query("sessions", "time < " . $cutoff);
	add_task_log($task, "The custom clear sessions task successfully ran.");
}

Tapi saya mencoba untuk mencoba lagi dengan jadwal

This is the hidden content, please
tapi sayangnya tidak berhasil

<?php
/**
 * MyBB 1.8
 * Copyright 2014 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/about/license
 *
 */

function task_clearcaptcha($task)
{
	global $mybb, $db, $cache, $lang, $plugins;

    $timeHours = 3;

    $cutoff = TIME_NOW - ($timeHours * 3600);

    $db->delete_query("captcha", "time < " . $cutoff);

	add_task_log($task, "The custom clear captcha task successfully ran.");
}

Keruntuhan berikut muncul

Mengutip:Kesalahan SQL MyBB – [20] array ( ‘error_no’ => 1054, ‘error’ => ‘Unknown column \’time\’ in \’where clause\”, ‘query’ => ‘DELETE FROM mybb_searchlog WHERE time

Foto ini dari Lihat Log Tugas

This is the hidden content, please

Yang bisa saya temukan hanyalah bantuan dalam memperbaiki kode dan mungkin menerapkannya ke tabel lain

Link to comment
Share on other sites

  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Days

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

×   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...