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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:07:01+00:00 2026-06-13T12:07:01+00:00

Here is a snippet of stuff that I have worked with another developer with,

  • 0

Here is a snippet of stuff that I have worked with another developer with, I am very basic in PHP and need to move across some of his code into my site.

This is part of the message that he has sent:

Next, please edit config.php. You need to supply and execute the
loadercsv.php from command line like this:

    $ php loadercsv.php

This will extract data from zip file and would populate database which
already must exists.

What does this really mean? I do understand this is quite a guessing game but would love to know if someone else could interpret what he is saying?

Also, below is the code from the config.php file, just incase it is needed:

<?php

// Temporary directory where data will be extracted. Must be directory, absolute path, writable.
define('DATA_DIR', '/CourseFinder/tmp');
// Location of zip file, must be readable and absoluate path.
define('ZIP_FILE', '/CourseFinder/assets/zip/ziplocation.zip');

define('DB_HOST', 'localhost');
define('DB_USER', 'removedforreasons');
define('DB_PASSWORD', 'removedforreasons');
define('DB_NAME', 'removedforreasons');    

define('MAX_LINE_WIDTH', 2048);
define('CSV_SEP', ',');
define('RESULTS_PER_PAGE', 10);

/*
 * List of CSV files to be loaded. These files are processed in order listed here.
 * In case some file does not exists, process will break.
 *
 */ 

/* Try to connect */
$connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

/* If cannot connect, simply exit. */
if (mysqli_connect_errno($connection)) {
    $msg = sprintf("Cannot connect to MySQL: %s", mysqli_connect_errno($connection));
    printf("ERROR: config.php - %s\n", $msg);
    exit();
}

/* Function to close the connection */
function close_connection($connection_to_close)
{

    mysqli_close($connection_to_close);
}

/* Register the function at shutdown. */
register_shutdown_function('close_connection', $connection);

?>
  • 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-13T12:07:01+00:00Added an answer on June 13, 2026 at 12:07 pm

    This seems to be very straight-forward:

    The program loadercsv.php is written to open a hard-coded zip file, process its contents, and insert the data into a database. The database itself is assumed to be set up and running.

    The name of the zip file and the credentials for the database access are stored in a separate file, config.php, which is presumably being included in the first file. That is, rather than providing the configuration options on the command line or in any other fashion, you simply edit the config.php file to contain the desired data.

    Finally, the program is simply run from the command line, with the command php loadercsv.php.

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

Sidebar

Related Questions

Here is a snippet that gets the job done on Android (v2.2) and various
Here is a snippet of my JavaScript Code that I want to DRY up:
I have a std::vector that holds a Point struct (x,y,z and some other non-pointer
I am pretty new to mobile stuff, jquery... Here is the situation I have
I have some HTML I need to parse. Basically I'm walking through the dom
I have a WinForms Application that I want to run at Mono at some
I have a snippet of code that applies a highlighting effect to list items
Consider this JavaScript code snippet: Object.prototype.log = function() { // here, you have a
I have a snippet of code that I'm calling from a service: context.registerReceiver(new BroadcastReceiver()
I have seen some of the questions/answers related to this topic here, however still

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.