WordPress.org

Support

Support » How-To and Troubleshooting » Retrieving Data From Database

Retrieving Data From Database

  • To retrieve some data from a table I created with MachForm, I put this code on a WordPress page, and got the error message below the ccde. I’m using the exec-php plugin. I also tried putting it in a .php file and got virtually the same error message as copied below.

    <?php
    mysql_connect(“localhost”, “database_name”, “password”) or die(mysql_error());
    mysql_select_db(“test”) or die(mysql_error());

    $result = mysql_query(“SELECT * FROM form_1”);
    $row = mysql_fetch_array($result);

    echo $row[‘element_1’];
    echo $row[‘element_2’];
    echo $row[‘element_3’];
    ?>

    Parse error: syntax error, unexpected ‘=’ in (path)/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 5

    Parse error: syntax error, unexpected ‘=’ in (path)/machform-1.php on line 5

    Any Help is so so so much appreciated.

    Bruce

  • The topic ‘Retrieving Data From Database’ is closed to new replies.
Skip to toolbar