Re: newbie lost on data import... part 3
| From: | jsWalter | Date: | Sun, 10 Aug 2003 05:17:45 +0000 |
| Subject: | Re: newbie lost on data import... part 3 | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29783@lists.php.net to get a copy of this message | ||
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