shalli Posted March 12, 2011 Share Posted March 12, 2011 Hi there Just wanted to know what everyone here would recommend to a newbie in php about adding php code to mysql database and then retreiving it I would like to create a is a php template site that allows user to choose the template they like and once the user selects the template it takes the user to a page that shows template code. The page use php variables to display the code from the database. as an example it like dreamweaver which allow you to choose from a selection of templates when creating a website Hope this make sense thanks for you time shalli Link to comment https://forums.phpfreaks.com/topic/230448-adding-html-code-into-mysql-database/ Share on other sites More sharing options...
djswebdesign Posted March 16, 2011 Share Posted March 16, 2011 Not sure if this is what you mean but I am pretty sure you could store an HTML template in a field in a mySQL database using BLOB as the data type. Link to comment https://forums.phpfreaks.com/topic/230448-adding-html-code-into-mysql-database/#findComment-1188309 Share on other sites More sharing options...
Daim Posted March 22, 2011 Share Posted March 22, 2011 You can just store the HTML code in a TEXT field in your mysql database. When you echo the HTML code make sure you echo it in a textarea. In my opinion it would be alot easier, to make a system that allows users to upload a zip file and a screenshot of the template. Link to comment https://forums.phpfreaks.com/topic/230448-adding-html-code-into-mysql-database/#findComment-1190785 Share on other sites More sharing options...
jenkyjay Posted March 30, 2011 Share Posted March 30, 2011 You can just store the HTML code in a TEXT field in your mysql database. When you echo the HTML code make sure you echo it in a textarea. In my opinion it would be alot easier, to make a system that allows users to upload a zip file and a screenshot of the template. Yeah the ZIP file and screen shot would be pretty good idea. If not, yeah, store it as a text. And just pull the data when necessary. Link to comment https://forums.phpfreaks.com/topic/230448-adding-html-code-into-mysql-database/#findComment-1194237 Share on other sites More sharing options...
Ionisis Posted March 30, 2011 Share Posted March 30, 2011 why don't you just readfile() the flat files? Link to comment https://forums.phpfreaks.com/topic/230448-adding-html-code-into-mysql-database/#findComment-1194265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.