Allow PHP in Posts and Pages
No HTML-Table possible for SQL-Query-Results (2 posts)

  1. MelHoch
    Posted 3 years ago #

    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


  2. Hit Reach
    Plugin Author

    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Allow PHP in Posts and Pages
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic