Retrieving Data From Database (1 post)

  1. Bruce
    Posted 5 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.

    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.


Topic Closed

This topic has been closed to new replies.

About this Topic