refiking Posted January 3, 2008 Share Posted January 3, 2008 How do I add a heading for each column in this script and how can I insert a vertical line in between each column? <?php include 'cnt.php'; $query = mysql_query('SELECT bfn, bln, cfn, cln, loan_id, status FROM Loans') or die('Error: '.mysql_error()); echo '<table>'; while($row = mysql_fetch_assoc($query)) { echo "<tr><td>{$row[bln]}, {$row[bfn]}</td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td>{$row[status]}</td></tr>"; } echo '</table>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/84362-solved-heading-lines-for-table/ Share on other sites More sharing options...
redarrow Posted January 3, 2008 Share Posted January 3, 2008 learn css sorry we do php Quote Link to comment https://forums.phpfreaks.com/topic/84362-solved-heading-lines-for-table/#findComment-429693 Share on other sites More sharing options...
refiking Posted January 4, 2008 Author Share Posted January 4, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/84362-solved-heading-lines-for-table/#findComment-430392 Share on other sites More sharing options...
adam291086 Posted January 4, 2008 Share Posted January 4, 2008 <?php include 'cnt.php'; $query = mysql_query('SELECT bfn, bln, cfn, cln, loan_id, status FROM Loans') or die('Error: '.mysql_error()); echo '<table>'; while($row = mysql_fetch_assoc($query)) { echo "<tr><td>adam</td><td>john</td><td>julie</td><td>Alex</td></tr>"; echo "<tr><td>{$row[bln]}, {$row[bfn]}</td><td>{$row[cln]}, {$row[cfn]}</td><td>{$row[loan_id]}</td><td> } echo '</table>'; ?> This is a php forum not a html one. The above may work Quote Link to comment https://forums.phpfreaks.com/topic/84362-solved-heading-lines-for-table/#findComment-430395 Share on other sites More sharing options...
refiking Posted January 4, 2008 Author Share Posted January 4, 2008 I got it. Thanks for letting me know that was html. I checked out a tutorial and all I had to do was add a border to the table. Then, go back to php when I needed to run a mysql_query. Quote Link to comment https://forums.phpfreaks.com/topic/84362-solved-heading-lines-for-table/#findComment-430410 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.