Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-13-2004, 11:04 AM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-13-2004, 11:13 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 07-13-2004, 11:18 AM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 07-13-2004, 11:27 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
Reply With Quote
  #5  
Old 07-13-2004, 12:04 PM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

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. The time now is 04:58 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03609 seconds
  • Memory Usage 2,190KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete