I'm using a mobile template for a personal site and I'm using it because of the menu format. The source and demo can be found here http://mobifreaks.com/free-mobile-website-templates/galaxy-mobi/ and all I have done to it is strip some of the content out of the page.
The menu is a CSS menu that is using jquery. I am using PHP to interact with a MySQL database so it is necessary to for me to use a PHP page. If I just save the page as a PHP page it works fine but when I add any PHP code to the page(in the body) both menu items are displayed like a normal list of buttons instead of a dropdown menu.
I add the following PHP to a post-content div:
<?php
while($rows=mysql_fetch_array($result) or die(mysql_error())){
?>
<table align="center" border="4" cellspacing="2" cellpadding="3" width="100%">
<tr><td>Date</td><td>Cateogry</td><td colspan="4">Decription</td><td>Credit</td><td>Debit</td></tr>
<tr><td class="datetable"><? echo $rows['date']; ?></td><td class="category"><? echo $rows['category']; ?></td><td class="description" colspan="4"><? echo $rows['description']; ?></td><td class="amount"><? echo $rows['amount']; ?></td><td class="amount"><? echo $rows['amount']; ?></td></tr>
<tr><td colspan="2" align="center"><a href="#top">Back To Top</a></td></tr>
</table>
<br>
<?php
}
?>
I'm curious if there's any way around this. If you would like any of my code or any more clarification, I'm happy to provide it. Thanks for all of the help.
or die()
is pointless. when there's no more results, you'll get a false which triggers the die, and you output a "no error occured" error message. – Marc B Dec 3 '13 at 17:26while(($rows = mysql_fetch_array($result)) !== false) {
? I think theor die
causes the script to stop running once there are no more rows. – Kyle Dec 3 '13 at 17:27