Can I import current website into database?

They have: 32 posts

Joined: Feb 2007

Hi! This is the first time I have created a dynamic website using mySQL. I need to convert a completely static website to a dynamic website. How would I go about importing the website into a mySQL database? Is it possible to do? There is somewhat consistency in the site, so I might be able to use the html tags.

Also, if that doesn't work, there is a version of it in InDesign, which from what I have been told, could export xml, but I am also having a difficult time trying to figure out how to do that also...I can partially export the xml to notepad, but I would rather not use InDesign.

Thanks!

Busy's picture

He has: 6,151 posts

Joined: May 2001

If your website structure is template based - ie all the pages are laid out the same, you just need to store the content in the database, not the layout.

something like:

<?php
// database query for this pages content, the result would be a variable called $the_pages_content which you'd call down the page
?>

.....

navigation or whatever
or
, or

<?php
echo $the_pages_content;
?>

, or
or

They have: 32 posts

Joined: Feb 2007

So, maybe I could put some if/then/while statements in the php so that I would be able to place it in the correct column the database?

Busy's picture

He has: 6,151 posts

Joined: May 2001

depending on your database structure (and pages content) all youd really need is an id, content and maybe permissions if others can edit it etc.

What I do for one of my sites is add a id number to the actual page, say index is 1, contact is 5, faq is 9 etc at the top of the page (uses different nav on each page) so the database query is half done as the id is already there to be called

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.