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 9206455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:10:46+00:00 2026-06-18T00:10:46+00:00

To describe my problem well i will firstly write few words about how my

  • 0

To describe my problem well i will firstly write few words about how my script work so far.
So there is a server which from time to time update XML under some address (lets say its (https://someaddress.com/feedback.xml). Then i have created a script which is being run one time daily ( using cron) that read the XML given and put new object in my database.

Now i want to get those objects in my another script ( it is important for me to create independent .php file which loads only newest object from feedback.xml. And here is the problem. I could load those values directly from database but this way I have a whole list of all records (I want only newest one) solution to this could be adding column in table which stores boolean value to New? question, but I cannot change in any way my database. I believe i could load those object to some array but then how can it be passed to another script? bellow i post method which i use to store records to database

$xmlstr = file_get_contents(url);

$xml = new SimpleXMLElement($xmlstr);

foreach ($xml->value as $a) {

    //method to check if record exist

    $rec= new Item($db);

    //method to set values of obj

    $rec->Store();
  • 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-18T00:10:47+00:00Added an answer on June 18, 2026 at 12:10 am

    If your scripts run on the same server, then there are a number of different approaches that might work:-

    (1) If your database already has a timestamp or a unique ID for the relevant row then you may be able to query the DB, order by one of these columns and then limit the results to 1 record.

    select [fields] from records order by created desc limit 1
    

    (2) As well as writing the results to the database, you could also persist them in a local file and read from that each time (how big are these result sets?).

    (3) Another option could be to use Memcached to persist the result set in memory so that your scripts remain decoupled but access to the information is very fast. If you haven’t used Memcached before then do take a look – it’s very good for just this sort of task and is simple to use.

    If your scripts are running on different severs then (1) would work but the others would need further thought.

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

Sidebar

Related Questions

I cannot think about a proper question title to describe the problem. Hopefully the
I´m trying to make a script, which will change the background and foreground color
I think the following image can describe the problem pretty well... https://www.dropbox.com/s/pd1syth3gce6qh7/ios_uimenucontroller.png I also
I will first describe the problem and then what I currently look at, in
Before I describe my problem, it might actually make it clearer if I start
It's difficult to describe the problem, but if you visit http://kinetichifi.com/listenpop.php it's really clear.
I have no idea how to describe my problem. It is the simplest way
Best to use an example to describe the problem. Lets say I have a
I'm sorry if this title doesn't describe the problem properly but I wasn't sure
First, a simple example to describe my problem. Model public class User { public

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.