Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/#findComment-1171709
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/227131-car-id-and-image-id/#findComment-1171713
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.