Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

I need to write my first script, where to start?

  • 07-04-2011 12:35pm
    #1
    Registered Users, Registered Users 2 Posts: 459 ✭✭


    I'm asking for some advice on where to start learning to code for web applications, what language should I begin with that best suits PHP and MySQL driven applications in a MS environment?

    I'd like to start by writing my first script and ask you guy's to help me as I go along:confused:

    I'll start by writing a script for an e-commerce website of which the bare-bones are up and running on Joomla/virtuemart on my IIS 7 webserver. I don't want to use 3rd party modules and want to hand code all that needs doing.

    The script needs to:
    • Access the vendors FTP
    • Download a CSV containing product info
    • Insert or replace "YOURIDHERE" (my afilliate ID) into a field on every row
    • Insert specific rows of the CSV into MySQL database (structure of original CSV and target database column's are different)

    :confused::confused::confused:

    I could just throw money at it...but that just plain ol' boring.

    Please help?


Comments

  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    CSU wrote: »
    I'm asking for some advice on where to start learning to code for web applications, what language should I begin with that best suits PHP and MySQL driven applications in a MS environment?

    Well PHP is a language in itself, and MySQL has a query language, so those would be a good place to start given those requirements.


  • Registered Users, Registered Users 2 Posts: 220 ✭✭dueyfinster


    Python has a class with methods for dealing with CSV and how they are laid out. Worth checking out...


  • Registered Users, Registered Users 2 Posts: 23,212 ✭✭✭✭Tom Dunne


    CSU wrote: »
    The script needs to:
    • Access the vendors FTP
    • Download a CSV containing product info
    • Insert or replace "YOURIDHERE" (my afilliate ID) into a field on every row
    • Insert specific rows of the CSV into MySQL database (structure of original CSV and target database column's are different)

    The way I would approach it is as follows:

    Get the FTP part working by performing the steps by hand (i.e. at the command prompt). Once you get that working, put it into a script (FTP /? is a good start :))

    Then wrap a Windows batch file around it and schedule the batch file via Windows Scheduler so it runs every day/night/whenever.

    Once you have got your file, you can then perform the pre-processing via PHP prior to insertion into the database using SQL.

    I don't know enough about PHP to say whether you can FTP directly from the language, maybe you can.


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭oeb


    Tom Dunne wrote: »
    I don't know enough about PHP to say whether you can FTP directly from the language, maybe you can.

    There are a number of classes available to allow you to do this.
    http://code.google.com/p/ftp-php/
    http://www.phpclasses.org/package/3174-PHP-Client-to-access-FTP-servers-in-pure-PHP-code.html


    That being said, the last time I had to do something similar to this, I just wrote the retriever in perl.


Advertisement