/    Sign up×
Community /Pin to ProfileBookmark

Collection of Objects

I’ve got a complex SQL command pulling data from two tables, running each one through a function. The end result is i’m creating an object for each row of my query. Then placing these objects into an array as a class.

Person class (each row)
PersonCollection (array of persons)

It seems to take between 5 & 7 seconds for my page to load.

Is there a way to store this somehow and not have to create it when a user goes from one page to another? or from personlist page to personview and back to list etc.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 01.2020 — A few options that come to mind:
  • * Do a little measurement to see if that 5-7 seconds is due to something that could be greatly improved via database and/or SQL optimization.

  • * Look at using [serialize()](https://php.net/serialize) and [unserialize()](https://php.net/unserialize) to store the object(s) in session data.
  • ×

    Success!

    Help @kiwis spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.7,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...