PDA

View Full Version : retrieve files



sukanya.paul
04-24-2007, 06:23 AM
hi..
my problem is tht i hv a form which uploads resumes for a folder called uploads.it also changes the name and stores it so tht 2 resemes dont get over written if de have the same name. i now need to retrieve resumes automatically given a search criteria. for example if the admin wants resumes of all candidates who score abv 75%,by enterin this value de can get all such resumes.
can any1 tell mehow to do it
thanks in advance
suk

boxxertrumps
04-24-2007, 01:19 PM
If the results are stored in an array...

<?php
function sort_by_percent ($ar, $pe) {
$rad = array();
foreach ($ar as res) {
if ($res[0] => $pe) {
$rad[] = $res;
}
}
return $rad;
}
$array = array(
array("score","name","position", "etc"),
array("score","name","position", "etc"),
array("score","name","position", "etc")
);
//Call it like this:
sort_by_percent ($array, "0.75");
// returns an array where scores are higher than the decimal.
?>

Twey
04-24-2007, 02:14 PM
It would be best to store information about the files in a database here. Then you could just do
select from files where score > 0.75;