gnawz Posted April 7, 2009 Share Posted April 7, 2009 Hello, I have a script to insert text data into a database which works well. I aslo have a script that uploads images to the database very well. however, I need to design a page that uploads both text and images. ie a CMS driven page where I can upload text and images mixed together. Any help? Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/ Share on other sites More sharing options...
Axeia Posted April 7, 2009 Share Posted April 7, 2009 Think you're in the wrong part of the forum and want to be PHP applications instead. At least it seems to be it looks like you're looking for a CMS such as e107, wordpress, joomla etc. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803816 Share on other sites More sharing options...
gnawz Posted April 7, 2009 Author Share Posted April 7, 2009 What I need is to be able to upload text and images all at once like CMS do. I don't want to have to revamp the site to CMS driven. Actually its like having my own CMS Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803831 Share on other sites More sharing options...
Axeia Posted April 7, 2009 Share Posted April 7, 2009 Simply use some <input type="file" /> along with textareas in the same form? If you already got both you simply need to combine them into a single form so they get submitted at the same time. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803843 Share on other sites More sharing options...
gnawz Posted April 7, 2009 Author Share Posted April 7, 2009 How do I write the SQL query? remember it has to be 1 query. How do I make a user add an image and text n the backend panel? i will need text and images to be stored in one field Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803873 Share on other sites More sharing options...
premiso Posted April 7, 2009 Share Posted April 7, 2009 Sounds like this project is way over your head. Start by learning SQL. The find a file upload in PHP Tutorial. If you do not even know the basics of SQL for File uploading you will not get very far, and we, do not have the time to take to research and explain every little bit to you, which is what you are essentially asking. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803877 Share on other sites More sharing options...
gnawz Posted April 7, 2009 Author Share Posted April 7, 2009 I know how to upload files using PHP to MySQL... I know PHP programming I have sections on mys site that I update via an admin panel... Stuff like News, Events, Careers and so on... that is text only however, i need to be able to add images as well to some pages. ie Add text on the left, an image on the right, text above, an image below...and store these in a database where the server picks them and displays on the browser. Hope I'm clearer now. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-803892 Share on other sites More sharing options...
Axeia Posted April 8, 2009 Share Posted April 8, 2009 You don't actually need to store the image itself in the database (although you could, but it will just fill up the database real fast without much advantage). Simply store the images on the server and link to them, try looking at for example fckeditor and I think you'll find what you're after. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-804292 Share on other sites More sharing options...
gnawz Posted April 8, 2009 Author Share Posted April 8, 2009 I already have that. I would like the images to be stored in the database. I am failing to do this. i can do it if I'm dealing with ie products such that I have a product title and then, description, then image. However, I want the images to be mixed with text, as in appear any where in text as inserted-but these images should come from the db Thanks alot. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-804296 Share on other sites More sharing options...
Axeia Posted April 8, 2009 Share Posted April 8, 2009 Well that's a whole lot harder as the only way I can come up with is when submitting it to the database checking all the image tags if they point to a page that can create images out of a $_GET parameter. Could you tell us the reason as to why you'd want to do it like that? It's a very unusual way to do things putting a lot more stress on the server then simply linking to an image. Simply mixing images with text can be done fine using links to normal resources on the server. So I'm not saying it's impossible, or that I don't want to help you. I am however reluctant to help unless you can come up with a compelling reason as to why you'd want to take this approach as I can't see any good reason as to why anyone would want to do this. Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-804302 Share on other sites More sharing options...
gnawz Posted April 10, 2009 Author Share Posted April 10, 2009 I just wanted everything to be in the DB. Well, i will have to stick to this way but the reason is the image display with content works well with localhost but doesn't work with my host and I'm not getting any help. I even don't know why.... I uploaded all my files Quote Link to comment https://forums.phpfreaks.com/topic/153046-upload-content-to-database/#findComment-806476 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.