Hello,
I am kinda new to the PHP world. I have writen the following SQL which works perfectly by itself in phpadmin, but errors out in PHP code.
INSERT INTO logs SELECT NULL AS log_id,
UNIX_TIMESTAMP(NOW()) AS log_date,'{L_ACTION_INDIVADJ_ADDED}' AS log_type,
CONCAT("$log_action = array('header' => '{L_ACTION_INDIVADJ_ADDED}','{L_ADJUSTMENT}' => '",
((member_earned - member_spent + member_adjustment) * -.1),
"','{L_REASON}' => 'Weekly 10% DKP Tax','{L_MEMBERS}' => '",
member_name,
"','{L_ADDED_BY}' => 'Lynx');") AS log_action,
'192.168.1.1' AS log_ipaddress,
'111' AS log_sid,
'{L_SUCCESS}' AS log_result,
1 AS admin_id
FROM members
WHERE (member_earned - member_spent + member_adjustment) >0;
I have broken apart the code, and have narrowed it down to the CONCAT line in the select:
CONCAT("$log_action = array('header' => '{L_ACTION_INDIVADJ_ADDED}','{L_ADJUSTMENT}' => '",
((member_earned - member_spent + member_adjustment) * -.1),
"','{L_REASON}' => 'Weekly 10% DKP Tax','{L_MEMBERS}' => '",
member_name,
"','{L_ADDED_BY}' => 'Lynx');") AS log_action,
How do I perform this function in PHP SQL code?
Thanks!