vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Table Field Inserts via query's (https://vborg.vbsupport.ru/showthread.php?t=128136)

hotwheels 10-02-2006 12:26 PM

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

briansol 10-02-2006 02:29 PM

you need to alter the database table first.

open up phpmyadmin, and add a new field to hold your data.

hotwheels 10-02-2006 06:13 PM

1 Attachment(s)
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

hotwheels 10-02-2006 09:53 PM

I figured it out........I have to make the new field table first, then run my query's..........thanks, hotwheels

hotwheels 10-03-2006 02:48 AM

sorry man......I will get someone to move it.

hotwheels 10-03-2006 02:50 AM

1 Attachment(s)
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 https://vborg.vbsupport.ru/attachmen...3&d=1159816358 This is where you are going to put in the new "title" and "description" fields.

Peace, hotwheels

hotwheels 10-08-2006 02:12 PM

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)

hotwheels 10-10-2006 05:39 PM

1 Attachment(s)
Forum home activity mod


All times are GMT. The time now is 05:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01044 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete