Here is the code I am having problems with:
Code: Select all
$file_handle = fopen("Product Database.csv", "r");
$Counter = 1;
while (!feof($file_handle)) {
$product_information = fgetcsv($file_handle);
If ($product_information[0] != "SKU"){
$nid = mysql_query("SELECT nid FROM drupal_node WHERE title = $product_information[2]"); //just get nid not *
//Insert data into the Drupal_uc_multigeog table
mysql_query("INSERT INTO drupal_uc_multigeog
VALUES ($nid, '946', '0.000', '0.000', $product_information[4], 'N;')");
mysql_query("INSERT INTO drupal_uc_multigeog
VALUES ($nid, '930', '0.000', '0.000', $product_information[5], 'N;')");
mysql_query("INSERT INTO drupal_uc_multigeog
VALUES ($nid, '960', '0.000', '0.000', $product_information[6], 'N;')");
mysql_query("INSERT INTO drupal_uc_multigeog
VALUES ($nid, '915', '0.000', '0.000', $product_information[7], 'N;')");
mysql_query("INSERT INTO drupal_uc_multigeog
VALUES ($nid, '900', '0.000', '0.000', $product_information[8], 'N;')");
echo $product_information[2];
echo $nid;
echo $product_information[4];
echo $product_information[5];
$Counter ++;
}
} It is just getting the nid value into $nid that is going wrong.
Kind Regards
Tom