We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

API calls, relationship problems with more than 1 call

Development and Programming

Bas van Ginkel's avatar
Bas van Ginkel
9 posts
15 years ago
Bas van Ginkel's avatar Bas van Ginkel

Hi there,

i’m coding a page to import a csv file into EE2 entries. I’m using the API to ensure data correctness.

Is there a limit on how fast you can input entries via the API call however? At the moment the script halt after the first new entry.

Before this code i’m checking to see if a record with the same data already exists. If not (NUM_ROWS == 0) then the submit_new_entry is fired. If complete it should loop around prepare the next data to be entered, next row of csv.

if ($query->num_rows == '0') {

    if ($this->EE->api_channel_entries->submit_new_entry(13, $datasql) === FALSE)
    {
        print "An Error Occurred Creating the Entry";
    } else {
        $succes++;
    }
} else {
        $existed++;
}

Does anybody have a clue?

       
Bas van Ginkel's avatar
Bas van Ginkel
9 posts
about 15 years ago
Bas van Ginkel's avatar Bas van Ginkel

Hi there,

have looked some further into this problem. And i think i have found something, hoping someone here can explain this a bit.

My script does multiple API submit_new_entry calls. These records are created but they contain a relationship.

After running the script with 4 entry’s 4 new articles are created. In the relationship dbase table only 1 new entry shows up.

And that relationship is of the LAST entry created.

Anybody got a clue? Somehow i’m missing some relationships. The REL_ID number is incremented by 4.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.