vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   php query help (https://vborg.vbsupport.ru/showthread.php?t=71926)

lancepoint 11-19-2004 06:16 AM

php query help
 
i need to remove threaddesc out of a table vbulletin_thread
This is what i used to add it ...


ALTER TABLE `vbulletin_thread` ADD `threaddesc` VARCHAR( 125 ) NOT NULL;

Now, no posts can be made because of the table has that extra row... Please help me. It should be something simple like remove from or delete from .. please respond with the full query command. Its The newest mysql version on unix based system.

thanks

Xenon 11-19-2004 01:46 PM

*moved to correct forum*

[sql]ALTER TABLE `vbulletin_thread` DROP `threaddesc`[/sql]

nevertheless vb does not have a problem when there are more fields at the threadtable.
we have more than one field added, and everything works as it should :)

lancepoint 11-19-2004 11:09 PM

THIS IS ERROR I GET>


HTML Code:

Invalid SQL:
                                INSERT INTO vbulletin_thread(title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline,
                                        iconid, visible, attach, similar, threaddesc)
                                VALUES
                                        ('THREAD TEST ETEST', 1100856269, 32,
                                        1, 0, 'DesignerBeat', 1,
                                        'DesignerBeat', 1100856269, 0, 1,
                                        0, '', '', 0)
                       
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136


thanks

Logikos 11-20-2004 04:10 AM

PHP Code:

Column count doesn't match value count at row 1 

That means the selected feilds in the query don't coun't up to the values. You have 14 feilds to insert into, and there are 15 values there. You either added one to many values into your query, or you missed a feild to insert into.

Here an example query, notice there are 5 feilds to insert into, and the values for all 5 feilds, you can't have 6 feilds and 5 values, or 6 vaules and 5 feilds, it all has to match in the order its being inserted into.

[sql]
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . " TABLE_NAME
(feild_1, feild_2, feild_3, feild_4, feild_5)
VALUES
(value_for_feild_1, value_for_feild_2, value_for_feild_3, value_for_feild_4, value_for_feild_5)
");
[/sql]

lancepoint 11-20-2004 04:43 AM

can you tell me how i should go about fixing it?

Logikos 11-20-2004 05:55 AM

what file are you getting the error from?

lancepoint 11-20-2004 07:29 AM

newthread.php is the php script

lancepoint 11-20-2004 07:30 AM

do you want to have a look at my file?

Dean C 11-20-2004 09:18 AM

Remove the original changes you made to the file or upload a fresh one :)

lancepoint 11-21-2004 08:50 AM

did that still got errors


All times are GMT. The time now is 03:04 AM.

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.00961 seconds
  • Memory Usage 1,731KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete