I have a table where multiple images are uploaded .. the fields in the table are
++++++++++++++++++++++++++
id,user_id,photo,position
++++++++++++++++++++++++++
There can be maximum 8 images against a user id.
Now if an user upload image in suppose 1 , 3 , 5 position
And when i have to return the array after fetching from the database
i will get the value for the 1 , 3 , 5 position but i have to return the array with all the position that is from 1 to 8
So as per the requiremnet position 1 will have the value of 1 from the database as there is value in the database but there is no value against position 2 so in the array the position 2 will be blank...
Basically the position that have value in database will hold the value from the database and those position that doesn't have values in database will be blank
positions are 1 2 3 4 5 6 7 8
How to do it in php?