jimboownz Posted February 9, 2011 Share Posted February 9, 2011 Hi people. Ive just made an account in here, because im in need of some help.. First of all im still learning php, and learned most basics ( so far ) hehe. But im making a small CMS, which is for car / mc sale. Dont mind the danish letters and words. but ofcourse they gotta be right. ive got it all connected to the mysql database, and it works when i submit it, but to the final question. when i post a car with it´s details etc, i want it to either make a folder for the specific car, or create a database / folder, to get all the images from, and then link to the images it self from the database, but the thing is which option should i choose, this gotta be simple so any one who dont know php, know exactly what to do etc.. and btw i got a upload form to upload images, can i make a select option to choose between which folder to upload the image to, or like above should i just throw it in one single folder. hope u guys can help me out.. cheers The code it self <code> <?php if (isset($_REQUEST["id"])) { $id = $_REQUEST["id"]; $sql = "SELECT * FROM bilernye WHERE id = " . $id . ";"; $resultat = mysql_query($sql) or die(mysql_error()); $post = mysql_fetch_array($resultat); $model = $post["model"]; $aargang = $post["aargang"]; $braendstuff = $post["braendstuff"]; $hk = $post["hk"]; $kilometer = $post["kilometer"]; $farve = $post["farve"]; $beskrivelse = $post["beskrivelse"]; $dato = $post["dato"]; $action = "rediger-nybil.php"; $titel = "Rediger bil"; } else { $model = ""; $aargang = ""; $braendstuff = ""; $hk = ""; $kilometer = ""; $farve = ""; $beskrivelse = ""; $dato = ""; $action = "nynybil.php"; $titel = "Opret ny bil"; } ?> </code> Quote Link to comment https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/ Share on other sites More sharing options...
QuickOldCar Posted February 9, 2011 Share Posted February 9, 2011 All the images can go into a central folder, save all the information in the database into fields also saving the image location/name in a field. You may want to add a timestamp to their images so is no duplicates uploaded. Each new car post would have it's own id if use auto-increment, so all the content would be associated to the id. Quote Link to comment https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/#findComment-1171709 Share on other sites More sharing options...
jimboownz Posted February 9, 2011 Author Share Posted February 9, 2011 Yeah i thougt of that way aswell.. But can u give and example code ?. cause im kind of stuck here, and i need a little guidence to get on with it.. thanks alot for your awnser mate Quote Link to comment https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/#findComment-1171710 Share on other sites More sharing options...
QuickOldCar Posted February 9, 2011 Share Posted February 9, 2011 Not that it's not impossible to give you an example code, but it is difficult to do a mock-up database and image upload/display for you. I been slowly working on a multi-files upload script that I'll show you the working example and also give you it in a download. It's not 100% completed, but it does work, I had more work to do on the category selects and navigation. http://get.blogdns.com/file/ And here it is packaged up including a database sql file http://get.blogdns.com/download/file.zip Quote Link to comment https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/#findComment-1171713 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.