How to fetch data from 2 table using ssp class?
<p>I want to fetch data from 2 table.</p>

<p>Here is my code</p>

<pre><code>$columns = array(
    array('db' =&gt; 'A.id', 'dt' =&gt; 0),
    array('db' =&gt; 'A.id', 'dt' =&gt; 1),
    array('db' =&gt; 'A.id', 'dt' =&gt; 2),
    array('db' =&gt; 'M.value', 'dt' =&gt; 3),
    array('db' =&gt; 'A.entrydate', 'dt' =&gt; 4),
    array('db' =&gt; 'A.name', 'dt' =&gt; 5),
    array('db' =&gt; 'A.slug', 'dt' =&gt; 6),
    array('db' =&gt; 'A.description', 'dt' =&gt; 7),
);
$_POST['otherquery'] = " type='testimonial' ";
$rows = $user_posts-&gt;testimionalgridfill($_POST, $columns);
var_dump($rows);
exit();

public function testimionalgridfill($GetData, $columns) {

    $joinquery = "FROM `user_posts` AS `A` JOIN `user_metapost` AS `M` ON (`M`.`user_postid` = `A`.`id`)";
    return SSP::simple($GetData, 'user_posts AS A', 'A.id', $columns, $joinquery);
}
</code></pre>

<p>This code give me error like this</p>

<blockquote>
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM <code>user_posts</code> AS <code>A</code> JOIN <code>user_metapost</code> AS <code>M</code> ON (<code>M</code>.<code>user_postid</code> = <code>A</code>' at line 3</p>
</blockquote>