Re: [PHP] Re: Not getting expected result from file()

2007-06-11 Thread Frank Arensmeier
If you are not able to get anything into your DB (and your connection is ok), then two things might be wrong: your input or the query string itself. Echo out the query string and try to use the query manually (directly with a MySQL client). If the query string is ok, you might check your

Re: [PHP] Re: Not getting expected result from file()

2007-06-11 Thread Richard Lynch
trim is probably sub-optimal, as you MIGHT have leading/trailing whitespace as part of the actual data at some point. You should trim off ONLY one last newline character, no more, no less. I dunno why it's not working still though... On Mon, June 11, 2007 12:14 am, kvigor wrote: OK, I trimmed

[PHP] Re: Not getting expected result from file()

2007-06-11 Thread kvigor
Found out the issue this afternoon. I realized that my .txt file was tab delimited and not space delimited. So I changed $space to equal $tab and query was successful! All is working now. Thanks to all who replied. I appreciate all. David Robley [EMAIL PROTECTED] wrote in message

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread David Robley
kvigor wrote: Hello, I'm using the file function create an array. I'm using a value from a form to see if it matches in elements in the array. My problem is I expect the condition to be true but info but my DB isn't populated as I in the right DB... =Code

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
Sorry I re-wrote for problem clarity. FYI whenever I do a var_dump it always shows $stringOne as being 2 characters less e.g. var_dump($foodlandPA[45]); var_dump($storeInfo); string(31) Wellston Foodland Wellston OH string(29) Wellston Foodland Wellston OH kvigor [EMAIL PROTECTED] wrote in

Re: [PHP] Re: Not getting expected result from file()

2007-06-10 Thread Jim Lucas
kvigor wrote: Sorry I re-wrote for problem clarity. FYI whenever I do a var_dump it always shows $stringOne as being 2 characters less e.g. var_dump($foodlandPA[45]); var_dump($storeInfo); string(31) Wellston Foodland Wellston OH string(29) Wellston Foodland Wellston OH This would be

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
OK, I trimmed the elements in the array. using var_dump() it shows strings are identical, however nothing is storing in DB still. view new code =//doesn't store in central still, also shows no MySQL errors. $theFileArray = file('C:\htdocs\folder1\file.txt');

[PHP] Re: Not getting expected result from file()

2007-06-10 Thread kvigor
Trimmed elements in the array. I still can't get it to store in central table. No MySQL errors either. :-( (Also, all form values are escaped.) Strings compared in if condition are now identical. newcode === theFileArray =