Raised This Month: $ Target: $400
 0% 

SQL table alter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pRED*
Join Date: Dec 2006
Old 04-25-2007 , 06:27   SQL table alter
Reply With Quote #1

Is there anyway to tell what column exist in a SQL table?

I want to edit the table I use for bf2 rank mod to allow more stuff to be saved.

I know I need to execute a command like this..

Code:
SQL ALTER bf2rank ADD moresavingdata INT(4)...
But how can I check if these columns exists (no point in creating the column every map change..) or how could I remember that the command had been run before so not to do it again.

Using SQLx btw.

Thanks
pRED* is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 04-25-2007 , 09:31   Re: SQL table alter
Reply With Quote #2

Maybe,
PHP Code:
ALTER IF NOT EXISTS lol INT(11
or soemthing?
wonsae is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 04-27-2007 , 10:10   Re: SQL table alter
Reply With Quote #3

Code:
SELECT * FROM bf2rank WHERE `anything`='something'
[...]
if(result>=RESULT_OK) ...
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-27-2007 , 13:11   Re: SQL table alter
Reply With Quote #4

http://forums.alliedmods.net/showthr...740#post463740
Deviance is offline
pRED*
Join Date: Dec 2006
Old 04-27-2007 , 18:00   Re: SQL table alter
Reply With Quote #5

That's just a table select deviance.
I was talking about adding more columns to an existing db not adding another row of data.

Anyway don't worry I just created a second table..
pRED* is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-27-2007 , 18:28   Re: SQL table alter
Reply With Quote #6

Quote:
Originally Posted by pRED* | NZ View Post
That's just a table select deviance.
I was talking about adding more columns to an existing db not adding another row of data.

Anyway don't worry I just created a second table..
Yeah, but it was more just to give the idea of how to do it
Deviance is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode