Jump to the post that solved this thread.
Solved: 5 Years, 9 Months ago Need help with database
#4
Solved: 5 Years, 9 Months ago
Hello, I required a great bit of code from a fellow member which works great:

// Require the Global file

define('IN_MYBB', 1);
require_once "./global.php";

// Write to DB

if ($mybb->user['usergroup'] == 10 || $mybb->user['usergroup'] == 4) {
	
	$db->insert_query("servers", array("status" => "ono"));
}

?>

The only problem I am having is that instead of overwriting the current 'off' thats stored, it creates a new one. Is there are a way to delete everything inside the category 'status' before it creates a new one?

Thanks in advance.

EDIT: Would this work?

$db->delete_query('servers', '*', "status = 'off'");
Or maybe this?
$db->drop_column("servers", "status");
Reply
Jump to the post that solved this thread.


Messages In This Thread
Need help with database - by Nineteh - 2015-09-13, 10:01 PM
RE: Writing to the database - by chack1172 - 2015-09-13, 10:14 PM
RE: Need help with database - by Nineteh - 2015-09-13, 10:16 PM
RE: Need help with database - by chack1172 - 2015-09-14, 12:43 PM
Database : Need Help - by Nineteh - 2015-09-13, 10:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)