Just for anyone out there wondering how to get the entry_id of an entry you’ve just created using the Channel Entries submit_new_entry() call…
if ($this->EE->api_channel_entries->submit_new_entry($my_channel_id, $my_new_entry_object) === FALSE)
{
echo "Couldn't create new entry.";
}
else
{
$query = $this->EE->db->query('SELECT LAST_INSERT_ID()');
$row = $query->row_array();
$entry_id = $row['LAST_INSERT_ID()'];
echo 'New entry_id = '.$entry_id;
}(the docs say use something like $entry_id = $this->EE->db->insert_id() which only ever returns 0 in my experience)
[EE 2.1.0 build 20100810]
Moved to Development and Programming by Moderator
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.