vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   SOLVED - Populating data into SQL works on one board, but not another - SOLVED (https://vborg.vbsupport.ru/showthread.php?t=205900)

Vaupell 02-19-2009 12:24 PM

SOLVED - Populating data into SQL works on one board, but not another - SOLVED
 
adding some "standard / exsample" data to my product.

Howewer on my "clean" test board data adds fine,
but when i test on my live board no data is added,
And "other" modifications should not have any influence on this at
all, since its using its own table, and its dureing installation..


Both my test and my live is 3.8.1 only difference is the SQL version.
On my local test board im running the latest
sql 5.1.3, and php 5.2.8
and my live server which i dont control, but is hostet at a webhost
i have sql 5.0.51a and php 5.1.6

Does the following query not work on any of the above version ?
how do i check, and if needed how do i rewrite ?
Exsample of what im trying to add
[sql]
$db->query_write("INSERT INTO `elinkscat` VALUES ('1', 'Default', '')");
[/sql]

on my local im using navicat to acces sql server tables and write the query's
i need, so i just have to wrab them with $db->query_write(" ...... ")


EDIT : Also tryed following which works on test board, but not a live board. :p (debug enabled on test ofcourse)

Removing the auto increase value
[sql]
$db->query_write("INSERT INTO `elinkscat` VALUES ('', 'Default', '')");
[/sql]

adding content to last entry, aswell as no auto value.
[sql]
$db->query_write("INSERT INTO `elinkscat` VALUES ('', 'Default', '1')");
[/sql]

content in both
[sql]
$db->query_write("INSERT INTO `elinkscat` VALUES ('1', 'Default', '1')");
[/sql]

All of these work on test board, but not on live.. huh ?

--------------- Added [DATE]1235054716[/DATE] at [TIME]1235054716[/TIME] ---------------

oh my god, im such an idiot..

" . TABLE_PREFIX ." :D :up:

Dismounted 02-20-2009 03:31 AM

It's good practise to always specify the fields you are inserting to! Furthermore, this is required in the vBulltin Code Standards document.

Vaupell 02-20-2009 05:07 AM

Quote:

Originally Posted by Dismounted (Post 1749570)
It's good practise to always specify the fields you are inserting to! Furthermore, this is required in the vBulltin Code Standards document.

dont get it ?

Dismounted 02-20-2009 05:18 AM

[sql]INSERT INTO table
(
'x',
'y',
'z'
) VALUES (
'value1',
'value2',
'value3'
)[/sql]

Vaupell 02-20-2009 05:23 AM

Quote:

Originally Posted by Dismounted (Post 1749661)
[sql]INSERT INTO table
(
'x',
'y',
'z'
) VALUES (
'value1',
'value2',
'value3'
)[/sql]

yes thank you that part i got.

but the reference to the manual you linked i dont get.

Quote:

$code = red_code($var); Don't code like this
$code = normal_code($var); Code like this

Dismounted 02-20-2009 05:41 AM

I linked to the section - look at the sub-categories on the left. (The page you landed on describes the key, if you read it.)

Vaupell 02-20-2009 07:20 AM

ahhh.. allright thank you! :D :up:


All times are GMT. The time now is 04:05 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.01001 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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