PDA

View Full Version : SOLVED - Populating data into SQL works on one board, but not another - SOLVED


Vaupell
02-19-2009, 12:24 PM
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

$db->query_write("INSERT INTO `elinkscat` VALUES ('1', 'Default', '')");


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

$db->query_write("INSERT INTO `elinkscat` VALUES ('', 'Default', '')");


adding content to last entry, aswell as no auto value.

$db->query_write("INSERT INTO `elinkscat` VALUES ('', 'Default', '1')");


content in both

$db->query_write("INSERT INTO `elinkscat` VALUES ('1', 'Default', '1')");


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

--------------- Added 1235054716 at 1235054716 ---------------

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 (http://www.vbulletin.com/docs/html/codestandards) document.

Vaupell
02-20-2009, 05:07 AM
It's good practise to always specify the fields you are inserting to! Furthermore, this is required in the vBulltin Code Standards (http://www.vbulletin.com/docs/html/codestandards) document.

dont get it ?

Dismounted
02-20-2009, 05:18 AM
INSERT INTO table
(
'x',
'y',
'z'
) VALUES (
'value1',
'value2',
'value3'
)

Vaupell
02-20-2009, 05:23 AM
INSERT INTO table
(
'x',
'y',
'z'
) VALUES (
'value1',
'value2',
'value3'
)

yes thank you that part i got.

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


$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: