forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: just_some_guy on November 01, 2007, 11:03:10 pm
-
Hello,
Not quite sure what is wrong here, the query works fine using `cpg1411_config` but when i use {$CONFIG['TABLE_CONFIG']} in replace of the other name i get an unexpected T_STRING. Its for my plugin and i have also globlized CONFIG too before this.
this works -
$sql = 'INSERT INTO `cpg1411_config` (`name`, `value`) VALUES (\'text\', \'text'\' ), (\'text\', \'text'\' ),(\'text\', \'text'\ ), (\'text\', \'text'\), (\'text\', \'text\' );';
cpg_db_query($sql);
this does not -
$sql = 'INSERT INTO {$CONFIG['TABLE_CONFIG']} (`name`, `value`) VALUES (\'text\', \'text\' ), (\'text\', \'text\'),(\'text\', \'text\' ), (\'text\', \'text\'), (\'text\', \'text\' );';
cpg_db_query($sql);
any ideas?
thanks,
-
{$CONFIG['TABLE_CONFIG']} only works within double quotes. Please don't ask general PHP coding questions here.
-
You should also review your use of backticks and single quotes.
-
Ok thanks guys, i managed to solve the problem by comparing the code amongst the code used in sami's copperad plugin. Turns out the problem was the (`name`, `value`) . and i used " .$CONFIG['TABLE_PREFIX']. " instead
Thanks!