snipt

Ctrl+h for KB shortcuts

MySQL

Extract image filepaths from a particular prog_gallery galery

SELECT f.filepath FROM prog_gallery_images gal_i JOIN node n ON n.nid=gal_i.i_nid JOIN image i ON i.nid=gal_i.i_nid JOIN files f ON f.fid=i.fid WHERE g_nid=352 AND i.image_size='_original'
https://snipt.net/embed/a061976420fd6e21363a2d5858b810da/
/raw/a061976420fd6e21363a2d5858b810da/
a061976420fd6e21363a2d5858b810da
mysql
MySQL
1
2019-05-20T16:53:32
True
False
False
/api/public/snipt/4888/
extract-image-filepaths-from-a-particular-prog_gallery-galery
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">SELECT</span> <span class="n">f</span><span class="p">.</span><span class="n">filepath</span> <span class="k">FROM</span> <span class="n">prog_gallery_images</span> <span class="n">gal_i</span> <span class="k">JOIN</span> <span class="n">node</span> <span class="n">n</span> <span class="k">ON</span> <span class="n">n</span><span class="p">.</span><span class="n">nid</span><span class="o">=</span><span class="n">gal_i</span><span class="p">.</span><span class="n">i_nid</span> <span class="k">JOIN</span> <span class="n">image</span> <span class="n">i</span> <span class="k">ON</span> <span class="n">i</span><span class="p">.</span><span class="n">nid</span><span class="o">=</span><span class="n">gal_i</span><span class="p">.</span><span class="n">i_nid</span> <span class="k">JOIN</span> <span class="n">files</span> <span class="n">f</span> <span class="k">ON</span> <span class="n">f</span><span class="p">.</span><span class="n">fid</span><span class="o">=</span><span class="n">i</span><span class="p">.</span><span class="n">fid</span> <span class="k">WHERE</span> <span class="n">g_nid</span><span class="o">=</span><span class="mi">352</span> <span class="k">AND</span> <span class="n">i</span><span class="p">.</span><span class="n">image_size</span><span class="o">=</span><span class="s1">&#39;_original&#39;</span> </span></pre></div> </td></tr></table>
drupal, prog_gallery