Daniel Israel wrote:
> On Jul 28, 2008, at 6:36 PM, Wade Smart wrote:
>
>> 20080728 2021 GMT-6
>>
>> I have been having a problem inserting data into the db. Well, that
>> isnt true. I
>> tested this thoroughly on my own system before uploading it to the
>> server and
>> then the error occurred right away.
>>
>> The query:
>> INSERT INTO
>> deer_product(deer_type,name,parent_father,parent_mother,parent_father_father,parent_father_mother,parent_mother_father,parent_mother_mother,parent_father_father_father,parent_father_father_mother,parent_father_mother_father,parent_father_mother_mother,parent_mother_father_mother)
>> VALUES ('doe', 'Jaky', 'Big Jake', 'Dropper Doe', 'MAx', 'Y-35',
>> 'Dropper', 'T
>> Condict Found''Angus', 'Waldvogel Chief Doe', 'Waldvogel Boomer',
>> 'Tex Doe', 'T
>> Condict Found')
>>
>> You'll see the problem is just before 'Angus'; there is no comma
>> there.
>>
>> I use this little script to handle the data query:
>> $lastdeerkey = end($deer_key);
>> foreach($deer_key as $key => $value){
>> if($value != $lastdeerkey){
>> $deer_key[$key] = $value.",";
>> }
>> }
>>
>> // put commas between values
>>
>> foreach($deer_data as $key => $value){
>> $deer_data[$key] = "'".$value."'";
>> }
>>
>> $lastdeervalue = end($deer_data);
>> foreach($deer_data as $key => $value){
>> if($value != $lastdeervalue){
>> $deer_data[$key] = $value.", ";
>> }
>> }
>>
>> I cant see that there is an error but can anyone see something I
>> missed?
>> Im not sure why id didnt put in a comma on that one item though.
>
>
> The reason you're not getting a comma there is because the previous
> value (Before 'Angus') is the SAME as the last value, so your logic is
> telling it not to add the comma.
>
>
> -D. Israel
20080729 0909 GMT-6
Wait, Im not sure that makes any sense. The second T Condict Found comes AFTER
the first which is the one missing the comma. Though I agree having two values
in two different fields is a problem - not much I can do about that since its
their data.
Wade