Title: Layout problem
Last modified: December 28, 2019

---

# Layout problem

 *  Resolved [jefflaws1](https://wordpress.org/support/users/jefflaws1/)
 * (@jefflaws1)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/)
 * running php_everywhere to render a table of query results breaks the page layout,
   quicklinks drop out of the admin bar when logged in and the table displays below
   the footer and side bars, anyone have an idea as to why?
 * Thanks in anticipation.
 * Jeff
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flayout-problem-46%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12275786)
 * I’m not familiar with “php everywhere”. I see you’ve posted in their forum, too.
 * 1) How/where are you inserting the code? Shortcode or something else?
 * 2) Show your code on pastebin.com or gist.github.com and put a link here.
 * The table appears *after* the footer content in your page source.
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12275792)
 * You should ask in the plugin’s support forum.
    [https://wordpress.org/support/plugin/php-everywhere/](https://wordpress.org/support/plugin/php-everywhere/)
 *  Thread Starter [jefflaws1](https://wordpress.org/support/users/jefflaws1/)
 * (@jefflaws1)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12276040)
 * Hi Steve, thank you for your reply. php everywhere adds a block to page editing
   to paste your code into and then on the main content block in the editor you 
   just call [php everywhere] where you want the code to display.
 * The php code is this:
    <?php include(“Getit.php”); $famname = htmlspecialchars(
   $_POST[‘familyname’]); $firstn = htmlspecialchars($_POST[‘firstname’]); $year
   = htmlspecialchars($_POST[‘year’]); $war = htmlspecialchars($_POST[‘war’]); $
   cemetery=htmlspecialchars($_POST[‘cemetery’]); $conn = new mysqli($host, $user,
   $pass, $db_name); // Check connection if ($conn_connect_error) { die(“Connection
   failed: ” . $conn_connect_error); }
 * $sql = “select * from memorials where Surname like ‘$famname%’ and FirstName 
   like ‘$firstn%’ and Cemetery like ‘%$cemetery%’ and Date_Of_Death like ‘$year%’
   and War like ‘$war%’ ORDER BY Surname”;
    $result = $conn->query($sql); if ($result-
   >num_rows > 0) {
 * echo”
    <table class=’pdres’ width=’100%’> <thead>
 * <th class=’sresh’ style=’color:#733b17; border: 1px #733b17 solid;’>Surname</
   th>
    <th class=’sresh’ style=’color:#733b17; border: 1px #733b17 solid;’>First
   Name</th> <th class=’sresh’ style=’color:#733b17; border: 1px #733b17 solid;’
   >Cemetery</th> <th class=’sresh’ style=’color:#733b17; border: 1px #733b17 solid;’
   >War</th> <th class=’sresh’ style=’color:#733b17; border: 1px #733b17 solid;’
   >Date Of Death</th> <th class=’sresh’ style=’color:#733b17; border: 1px #733b17
   solid;’>Date Of Birth</th> <th class=’sresh’ style=’color:#733b17; border: 1px#
   733b17 solid;’></th> </thead “; while($row = $result->fetch_assoc()){ $str = ‘
   [More](https://wordpress.org/support/topic/layout-problem-46/memorialdetails?value=&apos; . $row[&apos;Ref&apos;] . &apos;)‘;
 * echo”
    <tbody> <tr class=’sres’> <td class=’sres’ style=’color:#733b17; border:
   1px #733b17 solid;’>” . $row[‘Surname’] . “</td> <td class=’sres’ style=’color:#
   733b17; border: 1px #733b17 solid;’>” . $row[‘FirstName’] . “</td> <td class=’
   sres’ style=’color:#733b17; border: 1px #733b17 solid;’>” . $row[‘Cemetery’] .“
   </td> <td class=’sres’ style=’color:#733b17; border: 1px #733b17 solid;’>” . 
   $row[‘War’] . “</td> <td class=’sres’ style=’color:#733b17; border: 1px #733b17
   solid;’>” . $row[‘Date_Of_Death’] . “</td> <td class=’sres’ style=’color:#733b17;
   border: 1px #733b17 solid;’>” . $row[‘Date_Of_Birth’] . “</td> <td class=’sres’
   style=’color:#733b17; border: 1px #733b17 solid;’>” . $str . “</td> </tbody>”;}}
 * $conn->close();
    ?> Once edited and published if I visit the site while logged
   in the quick links in the admin bar drop down and out of the normal admin bar
   almost as if there is a break somewhere.
 * I am no expert when it comes to wordpress or php but before the last update everything
   was working fine under WP Exec PHP then it went to pot.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12276142)
 * It’s a shortcode, so you cannot echo. Stuff everything into a string, then return
   that string at the end of your function.
 * Also, it’s good practice not to put the styles inline. Assign classes to your
   elements, then put the styles in your CSS file (or use the customizer’s “additonal
   css”.
 *  Thread Starter [jefflaws1](https://wordpress.org/support/users/jefflaws1/)
 * (@jefflaws1)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12276938)
 * Thanks Steve but it turns out to be me being thick and stupid and not closing
   the table in the right place. Couple of hours re reading my own code and “hey
   presto” page works.
 * Many thanks
 * Jeff.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Layout problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [jefflaws1](https://wordpress.org/support/users/jefflaws1/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/layout-problem-46/#post-12276938)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
