ashna Posted April 9, 2005 Share Posted April 9, 2005 Hi there, I tried to use this on new oscommerce store and after updating all the file and running SQL script I get this error. Server: localhostlocalhost Database: ashnacre_ashnaashnacre_ashna Error SQL-query: INSERT INTO configuration_group( configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible ) VALUES ( '112', 'WYSIWYG Editor 1.7', 'HTMLArea 1.7 Options', '15', '1' ) MySQL said: Documentation #1062 - Duplicate entry '112' for key 1 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.lib.php on line 682 Any suggestion on this are welcome. Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2005 Share Posted April 9, 2005 112 could have been taken by another contrib - - it's not used by default. Try changing it to 113, 114, or even a higher number like 2112. It's just important that it be unique. -jared Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2005 Share Posted April 9, 2005 This is exactly the reason that I advocate using a PHP script to install database settings. In this case the authors have hardcoded an ID whereas with a PHP script it could query the table and return the next autoincrement. This will eliminate all issues like this with duplicate keys... Bobby Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted April 9, 2005 Share Posted April 9, 2005 I agree with bobby to a certain extent Just in mysql, you can fetch the max value and use max value+1 in the script as you can use variables in a sql script as well. It's more a matter of best practice rather than using PHP or not. KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2005 Share Posted April 9, 2005 Carine, Point well taken...you see the intent of an SQL or PHP based install for database settings. When I approached the issue with my contributions I realized that it would take less queries since not only will you need the the main configuration group entry but also the actual configuration table settings. For me the easiest solution was to use PHP and pass the insert_id value to the settings thereby saving at least 2 queries. Bobby Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.