ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Placing a Variable within a Query Where clause

January 06, 2011 7:46pm

Subscribe [1]
  • #1 / Jan 06, 2011 7:46pm

    webster10

    9 posts

    I need to pass a unique variable into the where clause in a Query.  I’m not sure how to write it.

    This is what I have:

    <?php 
    $pn ='{prod_productNo}';
    echo "<h1>$pn</h1>";
    ?>
    
    <!--  FINGER BOARD -->
     
    {exp:query sql="SELECT DISTINCT field_id_210 AS my_fingerBoard FROM exp_weblog_data WHERE field_id_215='$pn'"}    
    {/exp:query}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases