Suppose I have variable $image0 , $image1 , $image2 so on
Which can varies dynamically and generates from array.
And I have sql query to insert data like
Insert into table_name (id,entityid,value,image) values (1,123,"abc",$image0);
Insert into table_name (id,entityid,value,image) values (1,123,"abc",$image1);
Insert into table_name (id,entityid,value,image) values (1,123,"abc",$image2);
As there are 6 insertion query for different images of product.
But its not compulsory that each product images will be same in quantity, some products have 3 images or some have 5 images available.
So How can we check and pass that value to mysql query and neglect other query if only some variable are available.
Thanks