LEFTJOIN with non CMSB Table?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 7, 2016   (RSS)

By Dave - March 7, 2016

Hi Perch, 

Most of the CMSB function are going to assume the MySQL table starts with the table prefix set during install (usually cms_).  

So the cleanest way to do it would be with straight MySQL code.  Alternatively, you could use straight MySQL to insert the data into the CMSB tables.  

Hope that helps! Let me know any questions.  Thanks.

Dave Edis - Senior Developer
interactivetools.com

By Perchpole - March 7, 2016

Hi, Dave -

Thanks for the info. Could I just cheat and call my table cms_blah - or is there more to it than that?

:0)

Perch

By Dave - March 7, 2016

Yea, if the other program lets you have arbitrary table prefixes then you could just create the table in CMSB.

Generally once the mysql queries get more complicated I prefer to write them in plain mysql.  The LEFTJOIN option in getrecords was experimental and undocumented and I found it doesn't do a great job of making the (potentially complicated) task of joining tables all that much simpler than plain mysql code.  So when I write code myself I usually don't do it that way.  That said, I'd say experiment with a few ways and see what you can get working.  

Dave Edis - Senior Developer
interactivetools.com