Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-12T14:12:32.797Z
Answers.Text: Yeah I ended up bumping into that table and I see elementId is the entry id. Getting image data gets tricky I guess.
Answers.UserDisplayName: MrT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-11T15:34:13.373Z
Answers.LastActivityDate: 2015-03-11T15:34:13.373Z
Answers.UserDisplayName: Brad Bell
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-11T13:35:13.350Z
Comments.Text: Does it need to be a SQL query or are you open to using the built in Craft API?
Comments.UserDisplayName: Aaron Berkowitz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-11T14:17:29.610Z
Comments.Text: Have you taken a look at the `craft_elements_i18n` table?
Comments.UserDisplayName: Josh Angell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-12T14:11:26.560Z
Comments.Text: @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.
Comments.UserDisplayName: MrT
Tags: <slug>
Title: Querying database for slug match?
ThreadText: # 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**: @username_1: 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.  
  
  ---
  
  