Jump to content

Building query doesnt work


Recommended Posts

Im trying to build a query using a variable. Unfortunately my piece of code is not working. 

Im basically rewriting this query:

{{$topic_id = \IPS\Db::i()->select('topic_id', 'forums_posts', 'author_id="27"', NULL, 1)->first();}}

Into this (where author id is a variable)

{{$BuildQuery = \IPS\Db::i()->build(array('select' => 'topic_id', 'from' => 'forums_posts', 'where' => 'author_id=' . {$foundMemberId}, "", 'limit' => '1'));}}

What am I doing wrong in my 'build' code? 

Link to comment
Share on other sites

On 2-7-2017 at 8:37 AM, newbie LAC said:

There you found method build? I remember similar method in 3.X

I just blindly assume that the build method is inside the same location as the select method (since the select method works)

But I might be wrong, thats why I'm asking for assistance :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...