We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Bug Regarding Pagination

*Hello Friends,

I am using FetchAll function for joining tables :

$contacts = $this->db->fetchAll("SELECT * FROM project p ,contacts c WHERE p.id=c.project_id and p.user_id='".$id."'",Phalcon\Db::FETCH_ASSOC);

Giving me array such as

[0] => Array
       (
           [id] => 1
           [name] => myproject
           [user_id] => 23
           [uploaded_count] => 25500
           [verified_count] => 3
           [created_date] => 2014-08-12 04:48:34
           [updated_date] => 2014-08-12 04:48:34
           [project_id] => 11
           [first_name] => Rakesh
           [last_name] => Bitling
           [contact_email] => [email protected]
           [company_name] => Wipro
           [company_website] => www.wipro.com
           [company_address] => Baner
           [company_email] => [email protected]
           [company_country] => india
           [company_state] => MH
           [company_city] => PUNE
           [company_zipcode] => 411006
           [company_phone] => 726165575
           [company_revenue] => 45
           [company_revenue_range] => 987
           [company_employees] => 54
           [company_employee_range] => 6
           [company_industry] => IT
           [company_sub_industry] => TELECOM
           [company_quantcast] => 54
           [company_alexa] => 98
       )

But when I am passing to pagination it giving me error like:

Invalid data for paginator.

How to resolve this issue. Please help me...



27.6k

No I am not using Native Array Paginator. Using simple pagination But with join i am passing those records.



98.9k

You have to use the NativeArray paginator