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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:38:19+00:00 2026-05-13T06:38:19+00:00

I wrote a script to read the Netflix catalog and populate my DB. Everything

  • 0

I wrote a script to read the Netflix catalog and populate my DB. Everything worked fine as a web script (except for timeouts) so I shifted to calling directly from the console.

I noticed a few oddities, like __construct() no longer being called (but that was easily remedied using the class name as a function.

Now I can’t get my arrays to work as before, here’s the general idea.

(Actually I have tried a few combinations, so I’ll share them all)

1 – this worked in the web script version just fine, no longer works calling from console

//declare empty
var $genreArray=array();

//later I add values one at a time as the XML is parsed
array_push($this->genreArray,$attrs['term']);

//after I have parsed an entire "title" element, I iterate the array
foreach ($this->genreArray as $value) {
    // never gets called - array seen as empty
    $this->db->linkGenre($value,$this->title_uid);
}

2 – so I tried the PHP manual; recommendation – nothing

//declare empty
var $genreArray=array();

//later I add values one at a time as the XML is parsed
$this->genreArray[]=$attrs['term'];

//after I have parsed an entire "title" element, I iterate the array
foreach ($this->genreArray as $value) {
    // never gets called - array seen as empty
    $this->db->linkGenre($value,$this->title_uid);
}

3 – so finally I tried manually tracking the index

//declare empty array
var $genreArray=array();
var $gi=0;

//later I add values one at a time as the XML is parsed
$this->genreArray[$this->gi++]=$attrs['term'];

//after I have parsed an entire "title" element, I iterate the array
foreach ($this->genreArray as $value) {
    // never gets called - array seen as empty
    $this->db->linkGenre($value,$this->title_uid);
}

So I am totally stumped now.

Has anyone declared empty arrays and populated via console?

(All 3 of these work via the web – so I need a console expert here)


Thanks for the support, here are the additional details requested;

php -v

PHP 4.4.9 (cli) (built: Sep 17 2008 12:02:18)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies


Each snippet was tried in a separate run. What details about the class are you interested in?

I have used echo statements to verify that the code is being called as expected. And if I hit the script through a URL everything kicks off fine (for the first few thousand records until the timeout).


No errors are being thrown, I even tried adding…

error_reporting(E_ALL);
ini_set('display_errors', true);
  • 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-13T06:38:19+00:00Added an answer on May 13, 2026 at 6:38 am

    I noticed a few oddities, like __construct() no longer being called (but that was easily remidied using the class name as a function.

    It sounds like your command-line and web server PHP are different versions. Is your CLI PHP 4? The function phpversion() will tell you the version in both CLI and web.

    Have you checked your error log? You didn’t mention it, but that would be the first place to look.

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

Sidebar

Ask A Question

Stats

  • Questions 279k
  • Answers 279k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You didn't specify what version of SQL Server you are… May 13, 2026 at 3:31 pm
  • Editorial Team
    Editorial Team added an answer You can override any of the existing code completions, copy… May 13, 2026 at 3:31 pm
  • Editorial Team
    Editorial Team added an answer The two solutions that you mention will certainly produce something… May 13, 2026 at 3:31 pm

Related Questions

So I have these giant XML files (and by giant, I mean like 1.5GB+)
I have wrote a simple php script which reads an IMAP email account and
We have a Perl program that ran well on all Windows platforms so far.
I have a list of around 5,000 to 10,000 (individual user supplied) email addresses
A while ago, I wrote a program that outputs any localhost or network database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.