Support » Plugin: Allow PHP in Posts and Pages » No HTML-Table possible for SQL-Query-Results

  • Hello all,

    I am trying to echo an HTML-table with SQL-results from a database query with AllowPHP.
    What happens is, the header of my table is correctly echoed as a table. The results of my query are echoed as well but not as a table.
    Can anybody help?

    Here is my code:

    global $allow_php;
    $sql =
    "SELECT pic_and_link, DATE_FORMAT(valid_until, '%d.%m.%Y') as valid_until, value_of_this
    FROM wp_value";
    $result = mysql_query($sql);
    $allow_php->;_shared['my_query_results'] = $result;
    <table width="330">
    <td width="110">Picture</td>
    <td width="110" style="text-align: right;">Value</td>
    <td width="110" style="text-align: right;">Valid</td>
    global $allow_php;
    while ($my_row = mysql_fetch_array( $allow_php->;_shared['my_query_results']))
    echo "<tr>";
    echo "<td width="110">", $my_row['pic_and_link'], "</td>";
    echo "<td width="110">", $my_row['value_of_this'], "</td>";
    echo "<td width="110">", $my_row['valid_until'], "</td>";
    echo "</tr>";
    mysql_free_result( $allow_php->;_shared['my_query_results'] );

    Regards, Mel

Viewing 1 replies (of 1 total)
  • Plugin Author Hit Reach


    Hi Mel,

    Is this using the advanced filter feature of the plugin? if not, you will need to write the table code being echoed in a bbcode format (square brackets!)

    Hope This Helps,
    Hit Reach

Viewing 1 replies (of 1 total)
  • The topic ‘No HTML-Table possible for SQL-Query-Results’ is closed to new replies.