WordPress.org

Ready to get started?Download WordPress

Forums

Retrieving Data From Database (1 post)

  1. Bruce
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic