<p>If you're talking about querying using SQL directly, then the <code>craft_elements_i18n</code> table is where all of the slugs are kept.</p>

CC BY-SA 3.0
2015-03-12T14:12:32.797Z
Yeah I ended up bumping into that table and I see elementId is the entry id. Getting image data gets tricky I guess.
MrT
CC BY-SA 3.0
2015-03-11T15:34:13.373Z
2015-03-11T15:34:13.373Z
Brad Bell
<p>Does anyone know how to query the database to find entry data based on a slug? The only table field I see that contains slug data is in craft_entryversions.data  in json format. Anyone ever tried querying for matches?</p>

CC BY-SA 3.0
2015-03-11T13:35:13.350Z
Does it need to be a SQL query or are you open to using the built in Craft API?
Aaron Berkowitz
CC BY-SA 3.0
2015-03-11T14:17:29.610Z
Have you taken a look at the `craft_elements_i18n` table?
Josh Angell
CC BY-SA 3.0
2015-03-12T14:11:26.560Z
@Aaron: I have an array of slugs that I want to query for. I'm open to the API but I'm sort of new to plugin development. Not sure where to start. I imagine the API method would be better for getting images and such. If you can point me to the right direction, that would be great.
MrT
<slug>
Querying database for slug match?
# Querying database for slug match?

(Asked by: username_0 on 2015-03-11)

Does anyone know how to query the database to find entry data based on a slug? The only table field I see that contains slug data is in craft\_entryversions.data in json format. Anyone ever tried querying for matches?

**Tags:** slug

> **Comments:**
> **username_1**: Does it need to be a SQL query or are you open to using the built in Craft API?  
> **username_2**: Have you taken a look at the `craft_elements_i18n` table?  
> **username_0**: @Aaron: I have an array of slugs that I want to query for. I'm open to the API but I'm sort of new to plugin development. Not sure where to start. I imagine the API method would be better for getting images and such. If you can point me to the right direction, that would be great.  

---

## 1 answers

### Answer by username_3 on 2015-03-11. Score: 3

If you're talking about querying using SQL directly, then the `craft_elements_i18n` table is where all of the slugs are kept.

> **Comments:**
> **username_0**: Yeah I ended up bumping into that table and I see elementId is the entry id. Getting image data gets tricky I guess.  

---

