maxic0 Posted September 8, 2006 Share Posted September 8, 2006 Hi, i have another question.. Sorry.Well on my site i have news content, and when i want it to appear in its box i have to put..[code]<div id="header"></div><div id="content"><p>Content here!</p></div><div id="footer"></div>[/code]...But my information is stored in a database.Can someone please tell me how i would select each piece of info and put it inside the above, so each news content is in a seperate box?Thanks Quote Link to comment Share on other sites More sharing options...
maxic0 Posted September 9, 2006 Author Share Posted September 9, 2006 Bump! Quote Link to comment Share on other sites More sharing options...
jefkin Posted September 9, 2006 Share Posted September 9, 2006 making some assumptions about fields...[code]<?PHP#... db connection stuff, query your database table, ... somthing like "SELECT header, content, footer FROM ..."#... put results in array $resultsforeach ($results as $news_item){ ?> <div id="header"><?= $news_item['header'] ?></div> <div id="content"> <h4>... other content stuff ...</h4> <?= $news_item['content'] ?> </div> <div id="footer"><?= $news_item['footer'] ?></div><?PHP}?>[/code]I'm not sure if this is what your after, but hth.Jeff 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.