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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:31:47+00:00 2026-06-18T01:31:47+00:00

I’m developing a web application that uses some data from a remote database where

  • 0

I’m developing a web application that uses some data from a remote database where I have read-only rights. The data in this database, SATMANAGE, is updated every 5th minute. For my application I need some of the columns in one of the remote database tables, called IDIRECT_STATUS.

Atm. I have a cron job performing a query from the CLI and storing the data in a .txt file. It then truncate the local table and uses LOAD DATA LOCAL INFILE to repopulate the updated data.

This has worked out fine up until now. As the application is getting more and more complex, I need a way of altering the local ‘remotes’ table. While I now truncates the local ‘remotes’ table. I need to only update the table with the updated data from the remote ‘IDIRECT_STATUS’ table. This gives me the ability to have columns in the local ‘remotes’ table that don’t exist in the remote ‘IDIRECT_STATUS’ table.

This is what I’m looking for. on the left side is the remote table. I want to keep the right side, local database, updated with the left side, remote database, on the corresponding columns. This without truncating the local table so that the additional local columns keeps there state.

IDIRECT_STATUS                  remotes
-------------------------------|-------------------------------
id                             | id
netmodem_name                  | netmodem_name
nms_name                       | nms_name
ip_addr                        | ip_addr
serial_no                      | serial_no
last_date_online               | last_date_online
last_updated                   | last_updated
network_name                   | network_name
network_id                     | network_id
is_mobile                      | is_mobile
latitude                       | latitude
longitude                      | longitude
lnb_name                       | lnb_name
buc_name                       | buc_name
upstream_qos_profile_name      | upstream_qos_profile_name
downstream_qos_profile_name    | downstream_qos_profile_name
inroute_maximum_data_rate      | inroute_maximum_data_rate
outroute_maximum_data_rate     | outroute_maximum_data_rate
upstream_cir                   | upstream_cir
use_upstream_cir               | use_upstream_cir
crtp_enabled                   | crtp_enabled
INROUTE_GROUP_ID               | INROUTE_GROUP_ID
                               | excluded           (Not updated or deleted)
                               | excluded_to        (Not updated or deleted)
                               | shipowner_id       (Not updated or deleted)
                               | etc...             (Not updated or deleted ...)

Hopefully you awesome guys are able to help me. I anything is unclear please let me know and I’ll edit the question asap!

  • 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-18T01:31:49+00:00Added an answer on June 18, 2026 at 1:31 am

    I saw a field called last_updated in the left table. What I would suggest is to use a simple perl or php script to do the loading that would do the following:

    a) theck the newest update time from the local table
    b) select data from the remote table that has been update after the last insert
    c) update the local table with remote data

    in the php code it would look something like this:

    <?
    // select the last update time
    $sql = "select max(last_updated) as last_update_time from remotes";
    $r = mysql_query($sql);
    $row = mysql_fetch_assoc($r);
    // save the last upate time
    $last_update_time = $row['last_update_time'];
    
    // get newer rows from the remote database
    $sql = "select * from IDIRECT_STATUS where last_updated > ".$last_update_time;
    $r = mysql_query($sql);
    while ($row = mysql_fetch_assoc($r)) {
      // generate update queries
      $sql = "update remotes set netmodem_name='".$row['netmodem_name']."', ... last_updated='".$row['last_updated']."' where id=".$row['id'];
      // execute query
      mysql_query($sql);
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view passing on information from a database: def serve_article(request, id): served_article
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.