aztec Posted July 28, 2010 Share Posted July 28, 2010 Hello I have a website that is hard coded and I have decided to make it database driven, the current site works fine but to keep it up-to-date requires a lot of work. I do not use tables in the current website but use div's extensively and all of the styling is with CSS. If you go to http://www.westonheritage.co.uk/john1906.html you may get a better understanding of what I am saying. What I need to do is to create div's depending on the number of rows held in an array from a MySql query, an example of the div is:- <div id="content_bottom_container"> <ul> <div id="content_bottomleft"> <ul> <li><a href="John1884.html">Audrey Weston (1884-1937)+</a></li> </ul> </div> <div id="content_bottomright"> <ul> <li><a href="Sidney1889.html">John Derek Weston (1889-1964)+</a></li> </ul> </div> <div id="content_bottomleft"> <ul> <li><a href="Madeline1891.html">Maurice A Weston (1891-1965)+</a></li> </ul> </div> The code above creates 3 div's, 1 left, 1 right and a second left. You will also notice that the Href data is hard coded, I want to change this and input the data from the database. It is important that they are created in this strict order to maintain the shape of the site. I know this is pretty long winded but it is difficult to explain, a view of the website and a quick look at the source code will help explain it better. Kind Regards Quote Link to comment Share on other sites More sharing options...
trq Posted July 28, 2010 Share Posted July 28, 2010 You generate the divs as you output your data from the database. Really not sure where you are stuck. Quote Link to comment Share on other sites More sharing options...
aztec Posted July 28, 2010 Author Share Posted July 28, 2010 Hello Thorpe Not having done this before could you give me a reference to a tutorial or an example I could start to work with. Kind Regards Quote Link to comment Share on other sites More sharing options...
aztec Posted July 29, 2010 Author Share Posted July 29, 2010 Sorry Thorpe I must have forgot to engage brain when I got out of bed, but I just couldn't see it at all. I suppose it must be something to do with my age. Kind Regards 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.