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

  • Home
  • SEARCH
  • 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 7760639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:56:34+00:00 2026-06-01T13:56:34+00:00

I have a very AJAX-ish listing webpage created using Codeigniter where I want registered

  • 0

I have a very AJAX-ish listing webpage created using Codeigniter where I want registered users to be able to differentiate which listings they have viewed previously.

Current Attempt: On clicking the listing, the listing id is sent vis $.post() to serverside PHP, which inserts(using INSERT... ON DUPLICATE KEY UPDATE) the listing_id, user_id, view_timestamp into a table with viewed_id on autoincrement. Everytime the visitor does a new search, all the listing_id with his user_id is retrieved from the MySQL table via .getJSON(), and through a loop, the CSS of these previously viewed listings are changed.

My conern is whether this method involves too much work on the server.

  1. Will each user have a single row be better, with the listing_id viewed be serialized?
  2. Should I use cookies(automatically saved into database by Codeigniter?) instead?
  3. Insert new listings viewed via AJAX when user views it. But only retrieves the list of viewed listings’ id once if cookie containing all the viewed listing ids does not exist, else after sending newly viewed listings to the server to be inserted, the listing id is also inserted into the cookie. This way after doing new searches, there is no need to continuously query the database for the entire list of viewed listing ids.

Note: For an estimate of number of AJAX requests for previously viewed listings’ listing_id, average user will do a new search every 20 secs.

  • 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-06-01T13:56:36+00:00Added an answer on June 1, 2026 at 1:56 pm

    Spontaneously for this kind of functionality I wouldn’t involve the database and look at client-side solutions instead, like storing Json with the data using localStorage or alternatively cookies if you want wider browser support (or need to store it from your php-code and can’t do it from the javascript). If you have to store this information in your database, I would still look at solutions to cache the information on the client as much as possible, like how you described it in point 3.

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

Sidebar

Related Questions

I have a very simple problem. I'm trying to make an ajax call using
We have a very strange problem which we have yet to be able to
I have a very strange problem when I using ajax in symfony 1.4. I've
I have a very wierd problem. I created a login system with ajax and
I have a very simple scenario where I want to POST the form using
I have a very simple ajax call to refresh some data on my webpage,
I have a very simple ajax request: $.get(url, data) .done(function () { }) .fail(function
I have a very simple sinatra site that I'm trying to access via ajax
My $.ajax() is not serializing the button name and value. I have a very
I have developed an AJAX based game where there is a bug caused (very

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.