Hi,

This SQL is based on code I've seen used in many modules here. It is not working for someone using MySQL client library 4.1.7. I've no idea why, but it would appear the @t4 variable or last_insert_id() aspect isn't working.

Since this code is so widely used by Zen Cart modules I hope someone can see what's going wrong..

Thanks in advance for any replies.

Code:
SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4 
FROM configuration_group
WHERE configuration_group_title= 'Back In Stock Notifications';
DELETE FROM configuration WHERE configuration_group_id = @t4;
DELETE FROM configuration_group WHERE configuration_group_id = @t4;

INSERT INTO configuration_group VALUES ('', 'Back In Stock Notifications', 'Set Back In Stock Notifications Options', '1', '1');
UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4 
FROM configuration_group
WHERE configuration_group_title= 'Back In Stock Notifications';

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` ,  `use_function` , `set_function`, `date_added`) 
VALUES ('', 'Enable/Disable Back In Stock Notification', 'BACK_IN_STOCK_NOTIFICATION_ENABLED', '1', 'If enabled, when a customer comes across a product that is out of stock, the customer will be offered the chance to be notified when it is back in stock<br /><br />0 = off <br />1 = on', @t4, '1', NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''1''), ', NOW());

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added`) 
VALUES ('', 'Send Copy of Back In Stock Notification Subscription E-mails To', 'SEND_EXTRA_BACK_IN_STOCK_NOTIFICATION_SUBSCRIPTION_EMAILS_TO', '', 'Send copy of Back In Stock Notification Subscription e-mails to the following email addresses, in this format: Name 1 <email@address1>, Name 2 <email@address2>', @t4, '2', NOW(), NOW()
);
All the best...

Conor