Home > Backend Development > PHP Tutorial > Refer to the SQL generator for MongoDB input format by PHP_PHP tutorial

Refer to the SQL generator for MongoDB input format by PHP_PHP tutorial

WBOY
Release: 2016-07-13 17:44:15
Original
834 people have browsed it

In the past few days, I have referred to MongoDB’s incoming parameter format find({a:1,$or:{c:1,b:2}}) and wrote a data processing method based on this incoming method. Parse and output an array with analysis data for subsequent class use. I don’t know if this design method is practical. The comments inside may be wrong. After all, I copy and paste my own and there are many source codes. See the attachment. The test data is posted here. The results are so that I can show what I want to do. Welcome to share and give me advice (why is it so difficult to post a code)

Array
(
[parameters] => Array
(
[p11] => 1
[p12] => foo
[p13] => ; 1
                                                                                                      ‐                                                                                                                                                                                
[into] => t1

[write] => (`a`=:p11,`c`=:p12)

[detail] => Array
(
                                                                                   ( )

)

[query] => `c` = :p13 and `a` = :p14
[sql] => UPDATE `t1` `c` = :p13 and `a` = :p14 SET ( `a`=:p11,`c`=:p12) WHERE `c` = :p13 and `a` = :p14
)



http://www.bkjia.com/PHPjc/478772.html

www.bkjia.com

true

TechArticleThese days, refer to MongoDB’s incoming parameter format find({a:1,$or:{c:1 ,b:2}}) Such a representation method, I wrote a method that uses this incoming method to parse the data and output an array with the analyzed data, so that...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template