Guest User

Untitled

a guest
Dec 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. $filename= '/path/customers.csv';
  2. if (file_exists($filename)) {
  3. $file = fopen($filename, 'r');
  4. while (($line = fgetcsv($file)) !== FALSE) {
  5. $customerid = $line[0];
  6. $customer_name = $line[1];
  7. // this is where I am needing assistance, or guidance if I am way off base
  8. // I need to query each "estimates" post and find it's "customerid" field value,
  9. // if it matches $customerid - $line[0] from the CSV, I want to update the "estimates"
  10. // custom post type's "customer_name" field with the value of $customer_name - $line[1]
  11. }
  12. }
Add Comment
Please, Sign In to add comment