• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Sql Query !

dukzin

New Member
Joined
Aug 18, 2008
Messages
161
Reaction score
3
Hello OTland :D

i'm using this query to remove all frags of all persons.

"DELETE FROM `killers` WHERE `unjustified` = 1;"

can someone tell me how can i remove only 1 frag of all persons.

;s

thanks.

i'll Rep ++!
 
im not good at them but try this i got it from xampys war system and edited it
Code:
db.executeQuery("UPDATE `killers` SET `unjustified` -1 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ");")
 
Tried:
UPDATE `killers` SET `unjustified` -1 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ");

i got this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .' at line 1
 
the players are greatfull, you cleaned all their frags. :x


It removes all...
Don't blame me for your stupidity -.-

Edit; The code worked fine on a database I created.
If this doesn't work for you then it's your fault for not explaining.


So, in which column are the frags saved?-
 
@zisly
lol, im joking, dont blaming you. ;s

here it cleans all, what it can be?

It doesn't clean everything in the database I created for testing.
So, could you explain how the tables are set up? where are the frags stored?


Here is the test database I used:
PHP:
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- [url=http://www.phpmyadmin.net]phpMyAdmin[/url]
--
-- Värd: localhost
-- Skapad: 10 januari 2010 kl 06:27
-- Serverversion: 5.1.37
-- PHP-version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Databas: `zzzzzzzzzz`
--

-- --------------------------------------------------------

--
-- Struktur för tabell `killers`
--

CREATE TABLE IF NOT EXISTS `killers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `unjustified` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Data i tabell `killers`
--

INSERT INTO `killers` (`id`, `unjustified`) VALUES
(1, 5),
(2, 5);
 
@zisly
i use tfs 0.3.6pl1
with the default database.

i have 2 tables that i think can be.
killers
player_killers

#SORRY FOR DOUBLE :(
 
#Up, Nothing happen ;s
- same frags..

EDIT-

KILLERS Table SS.

tablex.jpg
 
Last edited:
Code:
"UPDATE `killers` SET `unjustified` = " .. unjustified .. "-1"

Wouldn't that work? But maybe " .. unjustified .. " doesn't work for sql, i don't know xD

EDIT; Ain't frags stored in players?
 
they are stored there,
cuz when i use the query to clean all frags it works,
but i want to remove 1 frag of all persons
 
Back
Top