I'm having trouble inserting with select in PHP.
- the statement runs fine in MYSQL
- The main problem is on the Select statement in PHP.
- I check on database
rolename
is inserted with the value object - The statement adds new row into "login" with value
$login
and "rolename" with value from another table which store default rolename hence the select statement.
$db->insert(Common::prefixTable("roles_user"), array("login" =>
$userLogin, "rolename" => $db->query('SELECT REVERSE(SUBSTR(REVERSE(SUBSTR(REVERSE(SUBSTRING_INDEX(REVERSE(option_value),":",1)),2)),4)) FROM '. Common::prefixTable("option").' WHERE option_name = "RolesManager"')));
Please help me check how can I use select statement with insert statement in php
.
Thanks