Well starting to get somwhere ๐
The main zip function no works and does what it should.
$file = realpath("pictest.zip");
$zip = @zip_open($file);
if($zip !== false) {
while ($zip_entry = zip_read($zip)) {
$imgName = zip_entry_name($zip_entry);
$imgSize = substr($imgName, 0, 2);
if($imgSize=="sm"){
echo "Small image = " . zip_entry_name($zip_entry) . "</br>";
}else{
echo "Large image = " . zip_entry_name($zip_entry) . "</br>";
}
if (zip_entry_open($zip, $zip_entry, "r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
$fp=fopen("../media/shoots/images/".zip_entry_name($zip_entry),"w");
fwrite($fp,$buf);
zip_entry_close($zip_entry);
}
echo "\n";
}
} else {
echo "zip file could not be found!";
}
The contents of the zip file are images, 1 small and 1 large.
I would like to write all content of the zip file to a database. most of this i can do but here's the tricky part.
my database
imgID
imgSM
imgXL
say i have 5 pairs. That would mean i would only need to run the input query 5 times๐ simple enough. i know looking at this script that it would not be the case. each image would be giving its own unique row. What i need is to input 5 rows. i am sure you know what io mean.
Can someone advise me on how i can do this?
Thanks
paul