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.

EE Entries in PHP Queries

October 03, 2010 6:34pm

Subscribe [2]
  • #1 / Oct 03, 2010 6:34pm

    webster10

    9 posts

    What is wrong with my syntax that it is not place the $pn in the query, even though it is echoing it prior to the query.

    {exp:weblog:entries weblog="guitars"}
    <?php 
    $pn ='{skuproductName}';
    ?>
    {/exp:weblog:entries}
    
    <?php
    include('/fmicprod/sku-datafeed-connect.php');
    echo $pn;
    
    $q = ("SELECT field_id_88 FROM exp_weblog_data WHERE field_id_101='$pn' ORDER BY field_id_88 ASC");
        $r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n
    MySQL Error: " . mysqli_error($dbc));
        if (mysqli_num_rows($r)) {  //  MAIN IF
        echo "<h2>Hello</h2";
        }
    ?>
  • #2 / Oct 03, 2010 7:41pm

    e-man

    1816 posts

    most probably a parse order problem, do you have php on input or output?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases