Removing a column from database & what result will it have

Started by mister-crax, February 10, 2011, 09:22:47 AM

Previous topic - Next topic

mister-crax

Hi there, i would like to ask, if anybody knows whether it's possible to drop a column from a table that's being used in smf (like the column "poster_ip" from the table "smf_messages") without creating errors in the forum when it's running.
I could try to do it myself and see what happens, but i wouldn't wanna cause some irrepairable damage since i am not very experienced with sql.

Thanks in advance!

Arantor

You can't just drop the column, because every query that attempts to access that column will fail. Just off the top of my head, that means the queries that read the posts, that save the posts and the profile IP tracking will fail.

What, exactly, are you hoping to achieve?

mister-crax

QuoteJust off the top of my head, that means the queries that read the posts, that save the posts and the profile IP tracking will fail.
in other words it will pop up an error msg right? That's what i was afraid of...  >:(

I would like to disable somehow the ip logging completely in the forum. I currently have the ip's from that column (and not only that one) frequently deleted, but that's not enough for me.

Arantor

Quotein other words it will pop up an error msg right? That's what i was afraid of...

It will basically break your forum, yes. You can't just remove chunks of the system at random and hope it'll just be smart enough to figure it out - computers aren't that smart.

QuoteI would like to disable somehow the ip logging completely in the forum. I currently have the ip's from that column (and not only that one) frequently deleted, but that's not enough for me.

I guess you don't care about banning troublemakers then...

Easiest way to do it is to go into QueryString.php, find function cleanRequest() and just after the global instructions, add:
$_SERVER['REMOTE_ADDR'] = '0.0.0.0';

It will nuke any incoming address to 0.0.0.0 for every user. It's certainly less hassle than actually ripping out the masses of code related to IP addresses.

mister-crax

interesting! I'll try it in a couple of hours and will keep u briefed! Thanks!!!  O:) O:)

mister-crax

Quote from: Arantor on February 10, 2011, 09:43:20 AM
Easiest way to do it is to go into QueryString.php, find function cleanRequest() and just after the global instructions, add:
$_SERVER['REMOTE_ADDR'] = '0.0.0.0';
ok, excuse me for my ignorance but would you mind explaining me how to do that exactly? Where do i find the QueryString.php so to edit it? :-[
Sorry for the "dumb" question!  :laugh:

Matthew K.


teddyuk


mister-crax


Matthew K.


Advertisement: