Re: newbie lost on data import... part 3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, now I am really sure it has to do with the vars I defined from my text
file...

Once I have the text file open, I'm looping through it...

 // pull RETURN off the end
 $trimmed = rtrim($lines[$x]);

 // Pull apart array element
 list($strDate,$strNum,$strName) = explode ("\t", $trimmed);

 // Make the Dte a mySQL Date Object
 $objDate = new Date($strDate);

 // Spit it out to double check what I've got
 echo '>' . $strDate . '< - >' . $strNum . '< - >' . $strName . '< <p />';

 // populate the array
 $aryFieldsValues = array( 'eps_id' => $x,
         'eps_name' => $strName,
         'eps_num'  => $strNum,
         'eps_air_date' => $strDate);

 // do the query
 $objResult = $db->autoExecute('cbs_eps', $aryFieldsValues,
DB_AUTOQUERY_INSERT);


This will insert NOTHING but the 'eps_id' which comes from the loop index.

Now, I added this before the array population...

 $strDate = '2002-01-09';
 $strNum  = '102';
 $strName = 'myName';

THIS WORKED!

This data was INSERTed into the database!

OK, riddle me this Batman!

God, I'm so lost!

Any ideas?

Walter





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux