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 :
- is format used in text best way point/refer image?
- is database design efficient?
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
Post a Comment