Show only 1 excel row in php

Discussion in 'PHP' started by pcz, Jun 23, 2011.

  1. #1
    I am using the php excel reader from google (http://code.google.com/p/php-excel-reader2/downloads/list)

    I am building an affiliate stats site and I want to display only one row from my excel file. How can I do that?

    Also is it possible to display a row that contains a certain word? For example "display the row that contains the tracker number 1234567".

    Thanks for your answer in advance.
     
    pcz, Jun 23, 2011 IP
  2. AdsMakeSense

    AdsMakeSense Active Member

    Messages:
    389
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Should look into the documentation on their website, I found this after a quick search:

    You can do a for loop, and loop through all the read values and only echo it when your $matchedvalue is shown.
     
    AdsMakeSense, Jun 23, 2011 IP
  3. pcz

    pcz Well-Known Member

    Messages:
    990
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #3
    the only problem is that I am new to such things and even if I would have found it wouldn't have known where to add it.
    THanks for looking after. I will try to experiment with it a bit.
     
    pcz, Jun 24, 2011 IP
  4. cmsexperto

    cmsexperto Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes, you can do this. With the help of Excel reader you can read the excel file just like as if you were reading data from MySql database.

    If you want my help then you most welcome.
     
    cmsexperto, Jun 24, 2011 IP
  5. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #5
    It might be easier to write an import script for your Excel file into MySQL. You could run it on a daily basis (or whatever suits) via a cron job to refresh the data. Then you can lookup the data in MySQL which will be a lot quicker than reading Excel.
     
    mfscripts, Jun 25, 2011 IP