Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2006, 12:26 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Table Field Inserts via query's

When writting an INSERT INTO, and the table doesn't exist for your query, how can you go about forcing a new table into a certain field?

Example:
PHP Code:
    $db->query_write("INSERT INTO " TABLE_PREFIX "profilefield (profilefieldid,title,description,required,hidden,maxlength,size,displayorder,editable,type,data,height,def,optional,searchable,memberlist,regex,form,html) VALUES 
In the above INSERT, i am trying to install a title in the table, but the title will not insert.

Right now the profilefield show's this
Quote:
profilefieldid,description,required,hidden,maxleng th,size,displayorder,editable,type,data,height,def ,optional,searchable,memberlist,regex,form,html
and i need to put title in to this section, so that right after profile field, it says "title" like this
Quote:
profilefieldid,title,description,required,hidden,m axlength,size,displayorder,editable,type,data,heig ht,def,optional,searchable,memberlist,regex,form,h tml
.......Is this even possible in 3.6, or do i need to try to write this for another table? I would really like this to be a profile addition, but i am not sure how to go about changing fields.

any help on this would be greatly appreciated. Hotwheels
Reply With Quote
  #2  
Old 10-02-2006, 02:29 PM
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Location: CT
Posts: 254
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you need to alter the database table first.

open up phpmyadmin, and add a new field to hold your data.
Reply With Quote
  #3  
Old 10-02-2006, 06:13 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please understand i am very new to this and i am trying very hard to read and write code. Any help is greatly appreciated.

K, i have one more table question real quick. It took my db query write, but i am not getting the name's of my custom profilefields, as seen in the picture below.

Let's say you have custom profilefields built in, and you want the title to be
$aa= 'Dog';

$a= 'What kind of dog?';

This is my query write
PHP Code:
$db->query_write("INSERT INTO " TABLE_PREFIX "profilefield (profilefieldid,title,description,required,hidden,maxlength,size,displayorder,editable,type,data,height,def,optional,searchable,memberlist,regex,form,html) VALUES (50,'".addslashes($aa)."','".addslashes($a)."',0,0,'20','20','50','1','input','','0','0','0','0','0','0','','0')"); 
So Now i have gone into mysql database and manually want to add 'title' and 'description' but i need these two new fields to understand that they are to pull the title and descrition from my custom profilefield.
Now,
Field would = title
Type would = ? ( i don't understand how to get this to pull my different characters/title's)
Length/Values1 would = 6 would be my guess on this one. (dog has only 3 characters) right?
Collation would = ? utf8 (i would guess)
Attributes would = UNSIGNED (again, that is just a guess on my part.)
Null would = NOT NULL
Default2 would = ? (no idea since i am trying to get this to pull from custom profile fields.)
Extra would = leave blank

I am not sure if i am asking this right at all, but i attached a picture of what it is starting to look like on my page, and what i am confused about.

Thanks, doug
Attached Images
File Type: jpg titlefield.jpg (202.4 KB, 0 views)
File Type: jpg profile manager.jpg (222.4 KB, 0 views)
File Type: jpg profile.jpg (199.7 KB, 0 views)
Reply With Quote
  #4  
Old 10-02-2006, 09:53 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out........I have to make the new field table first, then run my query's..........thanks, hotwheels
Reply With Quote
  #5  
Old 10-03-2006, 02:48 AM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry man......I will get someone to move it.
Reply With Quote
  #6  
Old 10-03-2006, 02:50 AM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Had my thread moved here.

And here is my new instructions text for timeslips3.6.......

For those that are going to use these instructions, please feel free to ask any questions you may have. I will support what i have written inside the instructions.

And once you are inside your phpmyadmin, when you go to set your new fields, you will basically be looking for this This is where you are going to put in the new "title" and "description" fields.

Peace, hotwheels
Attached Files
File Type: txt Instructions.txt (7.8 KB, 60 views)
Reply With Quote
  #7  
Old 10-08-2006, 02:12 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

K, instead of making the actual field edit's in your phpmyadmin, just run these 2 queries one at a time, and then follow deathemperors how too......These 2 queries, will add the correct fields....(My database has the fields set as "vbprofilefield", your's may be set as "profilefield" or "vb3profilefield", so just change the below to which ever your database field is.) If you have profilefield, then change the `vbprofilefield` to `profilefield` and run the query.....

PHP Code:
ALTER TABLE `vbprofilefieldADD `titleVARCHAR25 ) DEFAULT 'aa' NOT NULL AFTER `profilefieldid` ; 
PHP Code:
ALTER TABLE `vbprofilefieldADD `descriptionVARCHAR250 ) DEFAULT 'a' NOT NULL AFTER `title` ; 
(Thanks for the update friends, hopefully the instruction's will now help others when installing on 3.6)
Reply With Quote
  #8  
Old 10-10-2006, 05:39 PM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Forum home activity mod
Attached Files
File Type: zip Forumhome Activity Mod.zip (7.6 KB, 13 views)
Reply With Quote
Reply


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 05:16 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.04324 seconds
  • Memory Usage 2,271KB
  • Queries Executed 14 (?)
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
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (5)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete