sql-parser
sql-parser copied to clipboard
Relevant problems about missing join module in update statement of sqlparser are expected to be repaired
Dear sqlparser developer: Hello
Thank you very much and your team for developing PHP myadmin / sql-parser, an excellent PHP parser component with SQL grammar, which has helped me solve a series of crud-related interface problems. At present, I have used the software provided by you to implement a select SQL statement to complete a table, turn pages, query, repair. Change, add, delete operations.
I found a requirement in the process of using, that is, tables for join can also implement the update function, I hope you can add the corresponding function here.
For example, I have a select statement
Select u.*, ud. nickname from user u left join user_detail ud on u. id = ud. user_id where u.del = 0
I hope that I can update the data of the join table when I update it, but the syntax of the join part will be lost when this sentence is translated into the update statement at present.
for example
Update user u left join user_detail UD on u.id = ud.user_id set ud.ip ='33' where u.id = 1
This statement becomes $parser - > statements [0] - > build () code after new parser ($sql)
UPDATE user `u`SET ud.ip ='33' WHERE u.id = 1
The join part is missing, and there is no join module under the document update state in the hope of being resolved.
Thanks very much! Best wishes for sql-parser!
Dear sqlparser developer: Hello Thank you and your team for developing phpmyadmin/sql-parser, an excellent sql syntax analysis component for php, which helped me solve a series of CRUD-related interface problems. At present, I have used the software you provided to implement a select Sql statement, realize the complete, page turning, query, modify, add, delete operation of a table. I found a requirement in the process of using it, that is, the update function can also be implemented for the join table, and I hope you can add the corresponding function here. For example, I have a select statement select u.*,ud.nickname from user u left join user_detail ud on u.id = ud.user_id where u.del = 0 I hope that the data in the linked table can be updated normally when I update, but the syntax of the join part will be lost when this statement is translated into an update statement For example
update user u left join user_detail ud on u.id = ud.user_id set ud.ip ='33' where u.id = 1
After this statement passes through new parser($sql), the $parser->statements[0]->build() code becomes
UPDATE user u SET ud.ip = '33' WHERE u.id = 1
The join part is lost, and there is no join module under the update statement according to the document. Hope it can be resolved Thank you so much! I wish sql-parser better and better!
Hi @wheng82 I am sorry we did forget to reply to you
@devenbansod could you please have a look into it ?
🏓