jmack549
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: PHP in WordPressMaybe if I explained it better it would help. I checked and I only removed 30 lines of code. The top portion of code just connects to a DB, and then selects rows based on a criteria.
Then right before I cut off above it’s just saying while rows are found…then the code I posted starts. So when it finds rows it outputs the table.
Not sure why it causes it to push to the bottom of the page, I tested other themes and it does the same.
Forum: Fixing WordPress
In reply to: PHP in WordPressI’m not sure exactly what you’re asking, but the loop is near the bottom of the code, mainly because it relies on variables from the top part in able to work correctly.
Forum: Fixing WordPress
In reply to: PHP in WordPressSure, here’s some more info. This is some of my code:
<?php LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE LOT OF CODE echo " <center><table border=0 width=90% cellpadding=0 cellspacing=0> <tr> <th width=60% align=left><x4>Venue</x4></th> <th align=left><x4>Special</x4></th> </tr>"; while($row = mysql_fetch_array($result)) { $venue[$i] = $row['establishment']; $site[$i] = $row['site']; $deal[$i] = $row['body']; $address[$i] = $row['address']; $phone[$i] = $row['phone']; $query2="SELECT * FROM <code>users</code> WHERE <code>establishment</code> = $venue[$i]"; $results=mysql_query($query2); #$num_rows = mysql_num_rows($result); echo "<center><table border=0 width=90% cellpadding=0 cellspacing=0>"; echo "<tr>"; echo "<td valign=top width=60%> <hr> <x5><a href=" . $site[$i] . " class=x5>" . $venue[$i] . "</a>" . "</x5></br><x8>" . $address[$i] . "</x8></br><x7>" . $phone[$i] . "</x7></br>" . "</td>"; echo "<td valign=top><hr></br><x6>" . $deal[$i] . "</br></br></br> </td>"; echo "</tr></table>"; } echo "<hr width=90%>"; } ?>I cut out probably 100 lines of code, and then it echoes the table near the bottom of the code. Here’s what I am getting when I open the page in my browser (sorry for having to mark out info, it’s a person’s personal info).
Top of page: Top of Page
And when I scroll down: Bottom of Page
If I insert this exact same code into a non themed php file, it prints at the top. No clue why inserting it into wordpress is causing it to print at the bottom.