Quote:
Originally Posted by Mr Blunt
I don't know if it's a vbulletin bug or maybe me telling people to do something that's incorrect and I seek advise here as I don't wish to report it as a bug until someone with more knowledge tells me they think the same.
In my "whodownloaded this attachment" hack....
https://vborg.vbsupport.ru/showthread.php?t=91390
.... I require adding one new field to vb's existing "user" table.
Post#13 shows C.Birch with a 1064 error when running my query.
Now please note his error shows a space between the quote mark and the word "user". My query does not have a space there, and since that user IS a coder here, I suspect he did not cut n paste my query incorrectly (but possible since I didn't ask him to confirm).
1) Is this a vbulletin bug and it's adding a space when it shouldn't?
2) Is the query I ask people to run incorrect?
Why am I now thinking that the " marks should be '
Hmmm
HELP?
For now I asked my installers to manually edit the query with their prefix if they use one but I'd rather not leave it like that if possible.
Crap, I'm sorry I asked a question in here.
I didn't mean that.
Can someone move this please?
(or answer it and it will then be a "how-to", LOL)
Again, I am truely sorry.
|
if you are telling them to do a manual query and then tell them to cut and paste exactly the following query
PHP Code:
ALTER TABLE ".TABLE_PREFIX."user ADD COLUMN downloads TEXT NOT NULL
this will not work if they do a true cut and paste. The term 'TABLE_PREFIX' is a php definition from within vBulletin's resident filesystem. Unless they are using that query from within a php script that has called vBulletin's global.php, this term will not be defined, and MySQL does not know what that means.
I would tell the users to do the manual query
PHP Code:
ALTER TABLE *YourTablePrefix*user ADD COLUMN downloads TEXT NOT NULL
and to make sure that they replace the *YourTablePrefix* with what they have assigned the table prefix as, if any.
To explain better with your query, if the user who is running the query has a table prefix of "vb3_", then the query should be
PHP Code:
ALTER TABLE vb3_user ADD COLUMN downloads TEXT NOT NULL
for a manual run. Whereas a user that is not using a table prefix the query would look like this
PHP Code:
ALTER TABLE user ADD COLUMN downloads TEXT NOT NULL
This is most likely where your problem has occured. The user will be required to replace the TABLE_PREFIX with what their system is using, otherwise MySQL will be looking for a table that is nonexistant.