Moron Posted August 10, 2006 Share Posted August 10, 2006 Okay, I have my code pulling data from the database properly, BUT.... I can't seem to format it right for love or money. I'm good with HTML, so I initially just built an HTML table and then stuck my <?php......?> stuff inside the appropriate table section. Didn't work right.What I'm trying now is:[code]<?phpprint("<table border=10><tr><td>");while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR'].'<br />'; print("</td><td>"); echo $RESULT['Leave Code'].'<br />';} print("</td></tr></table>"); ?>[/code]It comes out as:[img]http://mywebpages.comcast.net/techie4/formatting.gif[/img]What I want is Leave Date, Leave Type (code), and Hours across each column. Anybody?Thanks in advance!EDIT: My semicolons aren't bumped down to the next line. It just did that when I pasted it here. As I didnt use the [b]CODE[/b] tags. Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 10, 2006 Share Posted August 10, 2006 So the first cell should contain a code, the date and some hours, not just the date as it does now? Where will you get the hours from? Quote Link to comment Share on other sites More sharing options...
Moron Posted August 10, 2006 Author Share Posted August 10, 2006 [quote author=king arthur link=topic=103720.msg413215#msg413215 date=1155220685]So the first cell should contain a code, the date and some hours, not just the date as it does now? Where will you get the hours from?[/quote]From left to right, it should read: Date, Leave Type, Hours, then go to the next line and repeat. The Hours are a table in the database are there's no calculation involved in my code. Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 10, 2006 Share Posted August 10, 2006 Just to be clear, you want Date in one cell, Leave Type in the next cell, Hours in the next cell, and then underneath that the next row, and so on? Quote Link to comment Share on other sites More sharing options...
Moron Posted August 10, 2006 Author Share Posted August 10, 2006 [quote author=king arthur link=topic=103720.msg413230#msg413230 date=1155221733]Just to be clear, you want Date in one cell, Leave Type in the next cell, Hours in the next cell, and then underneath that the next row, and so on?[/quote]Exactly.And thanks. Quote Link to comment Share on other sites More sharing options...
king arthur Posted August 10, 2006 Share Posted August 10, 2006 [code]<?phpprint("<table border=10>");while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo "<tr>"; echo "<td>"; echo $RESULT['Leave Code']; echo "</td>"; echo "<td>"; echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR']; echo "</td>"; echo "<td>"; echo $RESULT['whatever your hours field is called']; echo "</td>"; echo "</tr>";} print("</table>");?>[/code]Try that. Quote Link to comment Share on other sites More sharing options...
Moron Posted August 10, 2006 Author Share Posted August 10, 2006 [quote author=king arthur link=topic=103720.msg413249#msg413249 date=1155222915][code]<?phpprint("<table border=10>");while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo "<tr>"; echo "<td>"; echo $RESULT['Leave Code']; echo "</td>"; echo "<td>"; echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR']; echo "</td>"; echo "<td>"; echo $RESULT['whatever your hours field is called']; echo "</td>"; echo "</tr>";} print("</table>");?>[/code]Try that.[/quote]Works!You really ARE the king!Thanks! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.