MyBB Community Forums
SQL Query question - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.2 Series (https://community.mybb.com/forum-3.html)
+------ Forum: MyBB 1.2 General Support (https://community.mybb.com/forum-4.html)
+------ Thread: SQL Query question (/thread-25437.html)

Pages: 1 2


SQL Query question - weBex - 2007-11-07

My board's missing the Away Reason, I think I dropped the table by mistake.
Could someone tell me what query I should run to add it back?
Thanks.


RE: SQL Query question - Ryan Gordon - 2007-11-07

There isn't an "Away Reason" table and the point that you might have dropped the away reason column in the users table is very unlikely. It's much more likely you accidentally removed it from your template. You can add it back by reverting the postbit template


RE: SQL Query question - weBex - 2007-11-08

Tikitiki Wrote:There isn't an "Away Reason" table and the point that you might have dropped the away reason column in the users table is very unlikely. It's much more likely you accidentally removed it from your template. You can add it back by reverting the postbit template

... There is, I'm comparing 2 of my MyBB forum databases. It's under mybb_Users

The one that's having errors when updating profiles is missing AwayReason while the other one has it. I can post screenshots after I'm home from work to prove it.


RE: SQL Query question - MrD. - 2007-11-08

That's a column not a table.


RE: SQL Query question - weBex - 2007-11-08

Ah, I'm not a database person at all so I'm not really sure what's what, lol. Sorry.

Does anyone know how to put it back in?


RE: SQL Query question - Yumi - 2007-11-08

The database editor you're using should provide a feature to insert columns.

If not, you can use a query to add it back in - can't remember it exactly, but it's ALTER TABLE command.


RE: SQL Query question - weBex - 2007-11-08

Thanks, but I checked all over there isn't any option to insert columns. Does anyone know the proper SQL query? =)


RE: SQL Query question - weBex - 2007-11-08

Anyone?
This problem is also preventing new users from registering Sad


RE: SQL Query question - Ryan Ashbrook - 2007-11-08

ALTER TABLE `mybb_users` ADD `awayreason varchar(200) NOT NULL default '';

Try that.


RE: SQL Query question - weBex - 2007-11-08

Thanks, but it doesn't seem to work:
------------------------------------------------------------------

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unclosed quote @ 29
STR: `
SQL: ALTER TABLE mybb_users ADD `awayreason varchar(200) NOT NULL default '';

SQL query:

ALTER TABLE mybb_users ADD `awayreason varchar(200) NOT NULL default '';

MySQL said: Documentation
#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 '' at line 1