best way to store image references in text using mysql/php -


i have text contains multiple images.

imagine like

i ((image1)) , ((image2)) , ((image3))

i storing text in table statements

st_id|text 

i'm storing image path in images

img_id|path_on_disk 

i store relation between text , image as

ti_id(pk) | st_id | img_id | imagenumber  

here image number refers order image1, 2 , 3

so questions :

  1. is format used in text best way point/refer image?
  2. is database design efficient?
  3. when i'm using in php, follow :

    if fetched string has match (( , )) know have image, appropriate number , find in ti table using st_id , image_number else print text.

i think might not best way because going char char in long string , can affect efficiency. can better way if any?


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -