Jump to content

Need help about storing data into database!!! PHP/MYSQL


GFXUniverse

Recommended Posts

hi guyz m creating a website, about 3D products

 

for example i have 3D models in my website

table for MYSQL is 3d_models

Feilds:

id

name

description

thumbnail_image

preview_images???(we can only add single image URL)

 

but i wanna add multiple images for a product.

 

do i need to have another table called preview_images? that will be related to 3d_models table? or can it be done in a single 3d_models table?

 

i just need a blue print concept, Please help!!!!

hmmm i see it seems best way,,, but how can i give 3d_model_id to preview_images table?

 

Actually all the data would be inserted at the same time,,

for example

Table: 3d_models

id (Auto increment)

name (POST)

description (POST)

thumbnail_image (POST)

 

Table: preview_images

image (POST)

thumb (POST)

3d_model_id ??? how would i insert 3d_models' id here??? which is not auto increment?? and i don't know in advance that what id would be inserted for 3d_model's table id??

 

mmmmm finally i got it how can i do this :P and  would like to share with u guyz as well please correct me if there is another way to do it,,

 

SOLUTION:

 

Table 3d_models:

  • id
  • name
  • description
  • thumbnail
  • special_id

Table preview_images:

  • id
  • thumbnail
  • image
  • special_id

now there is a relation between 3d_models and preview_images tables

 

i can insert special id like this

$special_id  = md5($fileName . date("d-m-y") . time());

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.