Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Help needed (csv search)


Aceless

Recommended Posts

Posted

Hi!

I try to use a php class so strip out csv data from an extra field added in osc.

The parcecsv lib is found on google code.

 

The php script works nice, if I uce a .csv file (for test), but how to get this script to recive data from this extra field?

 

Code that works:

 (in head  tag:  require_once('parsecsv.lib.php'); )

	<?php 	
$csv = new parseCSV();
$csv->auto('_actor.csv');
foreach ($csv->data as $key => $row):
foreach ($row as $value):	
echo $value;
endforeach; 
endforeach; 
?>

 

This script works fine, and I can add a search string to each field in file, separated by comma.

 

What i need , is this script to recive data from field. I have tried with a standar field, for test. (ive added comma separated data in product description)

 

So the code would something like this. (i know its not correct, since i dont work )

		<?php 
$actors = $product_info['products_description'];	
$csv = new parseCSV();
$csv->auto(@actors);
......

 

So any tip how to integrate this script to recive data from field, instead of file?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...