Using ADO & PHP to query a CSV file

You may also like...

2 Responses

  1. noisymime says:

    Great work on this Lewis, its the only complete example for ADO CSV connections in PHP that I can find!

    I’m fairly new to PHP but I think there’s a small mistake in the lines that access the ADO resultSet:
    echo “\t”.ucfirst($recordSet->Fields($i)->Name).””.”\n”;
    and
    echo “\t\t”.$recordSet->Fields($i)->Value.””.”\n”;

    The Fields($i) should be Fields[$i]
    I know its small but it can drive a newby crazy 🙂

    Thanks again!

  2. Lewis says:

    Hi noisymime,

    Thanks for your post, it’s the first sensible non-spam comment I’ve had on this particular post!

    I see what you’re saying and it could potentially cause confusion but I think in this instance it’s because of the way you have to access the recordSet COM object that we use a normal bracket “()” instead of PHP’s square brackets “[]”. You’re actually calling a method of the recordSet object, you’re just using PHP’s COM interface to do it.

    Feel free to test though! 🙂

Discover more from lewisroberts.com

Subscribe now to keep reading and get access to the full archive.

Continue reading