SQL Query Bug Fix It

Job ID: 32903799

Budget: $10 – $15 USD

Read it carefully, we have this query which is inserting values in the table called users. For the value member_id we are running a subquery to select from the table reg_users the id of the member. The reason why there are single quotes with +, it's because we are trying to manipulate the query. At this moment this first subquery works correctly but what happends with the second subquery? The second subquery selects the pass from the table settings, the table settings and the value pass totally exists but this second query inside the INSERT INTO doesnt return nothing. When the execution of the query INSERT INTO finishs, all the values are stored correctly except notes column which finally inserts 0. I don't know why but if you delete all the ''+ it works correctly the whole sql statement but in this time we can not delete ''+ because we are altering the query. I need a solution for this issue.

INSERT INTO `users` (`username`,`password`,`max_connections`,`member_id`,`exp_date`,`notes`) VALUES ('pepeiousuario','sjeneoeoe','3',''+(select id from `reg_users` where username = 'PROBANDO')+'','1644622354','' + (select pass from `settings`)+'')#;')