PDA

View Full Version : how do you set negative integers?


Kran
12-04-2005, 02:37 AM
I heard you have to make the integers signed, but I don't know how, in specific I'm trying to make the post count negative. Anyone know how?

Marco van Herwaarden
12-04-2005, 06:28 AM
You could try (untested, backup your database first!!!):
ALTER TABLE user CHANGE COLUMN post posts int(10) NOT NULL default 0;

Kran
12-04-2005, 02:13 PM
Alright, trying :)

EDIT: I got this :(

An error occurred while attempting to execute your query. The following information was returned.
error number: 1054
error desc: Unknown column 'post' in 'user'

Marco van Herwaarden
12-04-2005, 04:09 PM
Oops the first one should have been posts also:
ALTER TABLE user CHANGE COLUMN posts posts int(10) NOT NULL default 0;

Kran
12-04-2005, 08:42 PM
trying :)

EDIT: okay, the query worked but when I set my post count to -1 it said post count 0 instead.

Paul M
12-04-2005, 09:28 PM
I've got to ask - why do you want negative post counts ?

Kran
12-04-2005, 09:58 PM
I've got to ask - why do you want negative post counts ?


Spammers, they don't deserve to be banned, but I don't think 0 is enough of a set back.

Kran
12-05-2005, 11:40 PM
bump :)

Hellcat
12-06-2005, 12:31 AM
trying :)

EDIT: okay, the query worked but when I set my post count to -1 it said post count 0 instead.
What happens if you set it to.... say "-9"?
Do you still get "0"?

Can you determine of what kind your posts column in the DB is?

I tried this myself a week ago and worked perfectely....

Man, without your bump I would have totally missed this ;)

Kran
12-06-2005, 12:45 AM
What happens if you set it to.... say "-9"?
Do you still get "0"?

Can you determine of what kind your posts column in the DB is?

I tried this myself a week ago and worked perfectely....

Man, without your bump I would have totally missed this ;)

same thing if -9...

I can't find the posts column, what's it under?

Marco van Herwaarden
12-06-2005, 06:31 AM
Run the following SQL, and copy th eoutput here:
DESCRIBE TABLE user;

Kran
12-06-2005, 07:41 PM
Run the following SQL, and copy th eoutput here:
DESCRIBE TABLE user;

#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 'TABLE user' at line 1

Marco van Herwaarden
12-07-2005, 05:28 AM
Oops my bad, that was Oracle syntax. Just use:
DESCRIBE user