Hello,
I am very new to PHP, sorry, but have an issue I am trying to resolve, any help would be appreciated.
I have a unix style flat file filled with item numbers delimited by a LF (OA).
Something like this (has about a thousand values):
234
1286
15678
255
12999
Then I have a MySQL database table that may or may not have these item numbers also in a field of the table.
table products
products_number (this may have the item number)
This is an inventory check, I need to loop over an array of the flat text file and see if each entry is already in the database table field for products_number.
Well I am lost, I tried for about a week now, I used the PHP file command to read the file, this apparently puts the data into an array, when I echo that it just returns "Array".
Then I was able to read and put into an array the data in that MYSQL table, I was able to read them and echo each entry from the table.
But, I have no clue how to pick each item from the flat file, like 1235 and loop over the MySQL array to see if it is there. This is for discontinued/out of stock items, there is another field products_active, value 0/1, if there is a match between the item number in the flat file and a value in the MySQL array I need to change the products_active value to 0 to make it inactive.
If anyone can understand what I am trying to say here and can offer some help I would really apprecite it.
Thank you.
I am very new to PHP, sorry, but have an issue I am trying to resolve, any help would be appreciated.
I have a unix style flat file filled with item numbers delimited by a LF (OA).
Something like this (has about a thousand values):
234
1286
15678
255
12999
Then I have a MySQL database table that may or may not have these item numbers also in a field of the table.
table products
products_number (this may have the item number)
This is an inventory check, I need to loop over an array of the flat text file and see if each entry is already in the database table field for products_number.
Well I am lost, I tried for about a week now, I used the PHP file command to read the file, this apparently puts the data into an array, when I echo that it just returns "Array".
Then I was able to read and put into an array the data in that MYSQL table, I was able to read them and echo each entry from the table.
But, I have no clue how to pick each item from the flat file, like 1235 and loop over the MySQL array to see if it is there. This is for discontinued/out of stock items, there is another field products_active, value 0/1, if there is a match between the item number in the flat file and a value in the MySQL array I need to change the products_active value to 0 to make it inactive.
If anyone can understand what I am trying to say here and can offer some help I would really apprecite it.
Thank you.