I'm trying to create a new entry from within the database. The section is defined in craft_sections, and the entries for craft_elements, and craft_entries seem correct after the script is run, but no entries are displayed in the UI.
If you really, really want to create an entry from within the database (you must have a VERY good reason to do so), then you should create a row in:
If you'd like the easier path, use Content migrations. Create a migration, and then add something like:
// Create the entry $myNewEntry = new craft\elements\Entry(); $myNewEntry->setFieldValues([ 'title' => 'My new entry', 'myCustomFieldHandle' => 'Look, I can even set a custom field!', 'myCustomCategoryFieldHandle' => [$categoryILookedUp->id], ]); // Save the entry. Everything else will be handled for you by Craft's API. Craft::$app->getElements()->saveElement($myNewEntry);