devonbnice Posted October 2, 2010 Share Posted October 2, 2010 Hello, I'm not very familiar with sql. I do alright with php. But I'm trying to create a table that could be added into users. that would have to values such as 1 and 2. I'm trying to do this so the users can have some customization free to have the game display how they want it. such as the default would be the number 1 in the table/column (whatever its called.) and if they wanted to turn it off then it would update the table/column and replace the number 1 with the number 2. so when im coding with php. I can just use "if" statements. EX. If ($ir['profilesetup'] == 1 ) { Rest of code here } if ($ir['profilesetup'] == 2 ) { Code Here. } Im sure you guys get what im saying. I just dont know how to create the sql bid. could anyone paste here how i would set this up? Where every you name the column/table just put "NAMEHERE" Thanks very much :) - Devon. Quote Link to comment Share on other sites More sharing options...
Djkanna Posted October 2, 2010 Share Posted October 2, 2010 Wouldn't it be [mysql] ALTER TABLE `users` ADD `profilesetup` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 [/mysql] Then something like mysql_query('UPDATE `users` SET `profilesetup` = 2 WHERE (`userid` = '.$userid.')'); Quote Link to comment Share on other sites More sharing options...
devonbnice Posted October 2, 2010 Author Share Posted October 2, 2010 thanks :D so simple but that seams to be what most people forger :p Quote Link to comment Share on other sites More sharing options...
Djkanna Posted October 2, 2010 Share Posted October 2, 2010 Your welcome. (: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.