Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6760471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:04:05+00:00 2026-05-26T14:04:05+00:00

Hi I am developing social networking website and need a suggestion. I am using

  • 0

Hi I am developing social networking website and need a suggestion. I am using codeignitor framework, php as core language and jQuery as client side script.

Now I want to implement user search functionality to the website where a user can search for another users.

If I am using pagination with php it is bit slow and performance is not fast and even if the database will be huge then it will be more slow.

so what I have tried is, I made query of first 1000 people and encoded with json and showing first 10 results at a time by using this plugin http://www.stephenrhoades.com/?p=8

Is there anyone who can help my what all thing I need to follow here including technology, tips, query, mysql database etc.

Here is my current function in model

    function search_user($cntry,$male,$female,$age_min,$age_max){

               $this->db->select('user_profiles.user_id,user_profiles.first_name,
               user_profiles.birthday,user_profiles.gender,user_profiles.picture,
               user_profiles.last_active,location.city,location.country');

     $this->db->from('user_profiles');

     $this->db->join('location', 'user_profiles.user_id = location.user_id');

     $this->db->limit(800);


    // Search condition :::: Country 

    if($cntry){
    $this->db->like('location.country',$cntry, 'both');
    }

    // Search condition :::: Male or Female 

     if($male==1 && $female==0) {  $g='Male'; $this->db->like('user_profiles.gender',$g, 'both');  }

     if($male==0 && $female==1) {  $g='Female'; $this->db->like('user_profiles.gender',$g, 'both');  }

     // Search condition :::: Age range
     if($age_min && !$age_max){

        $this->db->where('(YEAR(NOW())-YEAR(user_profiles.birthday)) >= ', $age_min);
     }


     if($age_min && $age_max){

        $this->db->where('(YEAR(NOW())-YEAR(user_profiles.birthday)) >= ', $age_min); 
        $this->db->where('(YEAR(NOW())-YEAR(user_profiles.birthday)) <= ', $age_max); 
     }


     $this->db->order_by("user_profiles.last_active", "desc"); 
     $query = $this->db->get();


     $data=array();
     foreach ($query->result() as $row){     
     $row->last_active=$this->online_status($row->last_active);
     $row->birthday=$this->birthday($row->birthday);
     $data[]=$row;
     }


    if ($query->num_rows() > 0)
    {
    return $data;
    }
    else
    {
    $data = array(
                'result' =>'404'
                 );
    return $data; 
    }


}

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:04:06+00:00Added an answer on May 26, 2026 at 2:04 pm

    There are numerous factors that could lead to this process being slow. These are questions that we’d need to address:

    • What columns are you searching in your database?
    • Are those columns indexed?
    • What does your query look like? Are you only returning necessary columns?
    • How quickly do you want to show results? Immediately as user types, or after they click ‘search’?
    • How do you return results?
    • How do you display results?

    Generally, you can search VERY large datasets in a matter of milliseconds – so I doubt the database is the issue as long as you have things set up correctly.

    OK, with all that being said…

    If you do have a VERY large social network, I would recommend implementing something like Zend Search Lucene. It’s a search index and can be implemented into CodeIgniter pretty easily:

    http://www.cmjackson.net/2009/02/17/how-to-use-zend_search_lucene-with-the-php-framework-codeigniter/

    You can add your users, their profile data, posts, comments, etc. into the index and search it with a powerful language processing query language, and return results very quickly and in any format you wish. This is very easy to turn into a “live” search with ajax and json.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing something like a social networking website. I've got task to do
I'm currently developing a large site that handles user registrations. A social networking website
To be succinct: This startup is developing a social networking website specifically for video
I am developing a social application using ASP.net and C# under .Net Framework 4.0.
I'm developing a social networking website, and improving the front-end with some spit and
I'm developing a REST API service for a large social networking website I'm involved
I am developing a social networking site. It has functionality like user registration, people
I'm developing a social network using Microsoft Technologies. I want to make a Wall
I'm developing a social game in Flash with a team of developers. Our server-side
I am in the middle of developing a PHP social media web application which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.