• Resolved bluesoul

    (@bluesoul)


    I’m setting up a WP site for a computer services company, and they need a work order form. I’m setting it up as a page, and the relevant tables are in the same database as the WP install. I’m using Grimp’s PHP plugin to run the code. The code block is as follows:

    $query = "SELECT * FROM techs WHERE 1";
    $q = mysql_query($query) or die(mysql_error()); ?>
    <select name="tech">
    <?php while($row = mysql_fetch_assoc($q)) { ?>
    <option value="<?php echo $row['TechID']; ?>"><?php echo $row['techname']; ?></option><?php } ?>
    </select>

    It works on it’s own (here), but when I use the same code block on a WP page I get outward-facing HTML like so:

    <select name='tech'>
    <option value="">
    </option>
    </select>

    When I echo $q I get a resource link identifier, and even doing mysql_num_rows in an echo gives the correct result. So I’m at a loss as to why the code is breaking. Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bluesoul

    (@bluesoul)

    I’ve found where this IIS7.5 machine keeps the php error log, it’s not spitting it out to the browser for some reason.

    [19-Sep-2011 22:21:56] PHP Parse error:  syntax error, unexpected $end in wp\wp-content\plugins\grimp-php\grimp-php.php(75) : eval()'d code on line 1
    [19-Sep-2011 22:21:56] PHP Parse error:  syntax error, unexpected '}' in wp\wp-content\plugins\grimp-php\grimp-php.php(75) : eval()'d code on line 1
    Thread Starter bluesoul

    (@bluesoul)

    Changing from Grimp’s plugin to exec-php has fixed this.

    Issue resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Working PHP/MySQL block breaks in 3.2.1’ is closed to new replies.