The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP Skills not there. Need Query Help
Alright, as the title says I'm not too intelligent when it comes to queries yet so I have a question.
I'm sure this may come easy to most of you, so here goes. I want to take information that they type in their profile and put it into a field in my DB. I've already created the new field in my user table. I use a prefix "wireless" The new field is called "fromwho" without the quotes and it uses the "varchar" of 125. The Null is set to No and for default field it is blank. If that matters. So once they go into their profile, there is a required field asking where did they hear about my site, it's also in the registration as well. So once they either insert it into the registration or their profile, if they were registered before I implemented that field, that their info they put in that box will be updated into the user table under the field fromwho. I'm not exactly sure if I have to do a update table or change table or the syntax I have to use. I tried a few things but was lost. Obviously I need to run a query with table prefix changing or updating the user table under the fromwho field . The fromwho field is setup already as I have said, all that is left is for me to get the actual query i need to put in the profile page or register page. Also it has to be the text their inputted because it's a empty text box, not a radio button etc. Any help would be great. |
#2
|
||||
|
||||
Well, actually: Why don't you just create a custom profile field?
That way you can have all you want without caring moch about the coding |
#3
|
|||
|
|||
Yeah, I've created the custom profile field. But I want that data in the user table instead of going into the _userfield.
It's just a personal preference having it there because it makes it alot easier when checking things in the DB. Maybe just a stupid personal preference over anything, but I'd rather have that info go into the user table over the userfield. |
#4
|
||||
|
||||
Well, but actually that way you have to code much more, on the other hand it would just be one join if you have to call it seperately
but your query anyways: [SQL]UPDATE wirelessuser SET fromwho = 'xyzruf' WHERE userid = x[/sql] |
#5
|
|||
|
|||
Ok maybe I was a little bad on the description I think. That query would just be something I'd run manually as opposed to putting it in the register.php file or profile.php file right?
I want to put it in one of those 2 files so that the info that members place in that Field will be automatically put into the fromwho field. So, currently the register or profile.php files run a query and the info they put goes into userfield. Well I want it to automatically go into the user table in the fromwho field without doing any manul queries. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|