Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
The query in the file is correct, needs PHP cleaned out, and you'd used substitutions instead of the posts (e.g. [username]). The second query is where the problem really comes from as you need the last insert id which to do that you just use "SELECT LAST_INSERT_ID()".Can I use the same wording if I only remove the $POST bit ?
Please Log in to join the conversation.
# INSERT Sales Person
INSERT INTO #__enmasse_sales_person(name,user_name,address,phone,email,zip_code,city,country,published,created_at,updated_at)
VALUES(
"[name]",
"[username]",
"[address]",
"[phone]",
"[email]",
"[zipcode]",
"[city]",
"[country]",
"1",
NOW(),
NOW()
);
# INSERT Merchant
INSERT INTO #__enmasse_merchant_branch(name,user_name,sales_person_id,branches,zip_code,city,country,published,created_at,updated_at)
VALUES(
'[name]',
'[username]',
LAST_INSERT_ID(),
'{"branch1":{"branchname":"branch1","name":"[name]","description":"","google_map_width":"200","google_map_height":"200","address":"[address]","telephone":"[phone]","fax":"[fax]","google_map_lat":"","google_map_long":"","google_map_zoom":""}}',
'[zipcode]',
'[city]',
'[country]',
'1',
NOW(),
NOW()
);
# UPDATE usergroup
INSERT INTO #__user_usergroup_map(user_id,group_id)
VALUES
('[user_id]', (SELECT merchant_group FROM #__enmasse_setting)),
('[user_id]', (SELECT sale_group FROM #__enmasse_setting));
Please Log in to join the conversation.
Please Log in to join the conversation.