Yeah everything was working fine, until the user requirements changed slightly and I had to change the search option so that instead of only searching under ONE qualification, I had to provide the option to search under MANY qualifications.
As an example of the URL link in question, here's what the code that I use states:
<a href=\"$PHP_SELF?majordis_exp=$majordis_exp&subspeciality_exp=$subspeciality_exp&country_exp=$country_exp&qualification_exp=$qualification_exp&language_exp=$language_exp®ions_exp=$regions_exp&page=$back_page&limit=$limit&col=$col&order=$order\" title=\"Previous Page\" onMouseOver=\"self.status='Previous Page';return true\" onMouseOut=\"self.status='';return true\"><< Prev</a> \n");
Obviously, a lot of this in simply parsed data, but the most critical aspect is being able to "parse" multiple entries; in this particular case being the "$qualification_exp" field (and it will only be the case for the qualification - everything else is SINGLE data selection!). This currently has been set up as follows on the initial PHP/HTML search form:
<select accessKey="q" name="qualification_exp[]" multiple size="5" onMouseOver="self.status='Please select a qualification';return true" onMouseOut="self.status='';return true" title="Please select a qualification">
<option value="" selected>[Select a qualification]</option>
<?php
while (list($id, $qualname) = mysql_fetch_row($resultqualificationexp)) {
echo "<option value=$id>$qualname</option>";
}
mysql_free_result($resultqualificationexp);
?>
With the results summary page code as follows:
if ( ($majordis_exp || $subspeciality_exp || $country_exp || $language_exp || $qualification_exp) && ($regions_exp) ) {
$query="select distinct id, title, first_name, middle_name, surname, perm_address, perm_country, approved, sentdeclined, qualification, regions_id from cv
inner join major_disc_exp on cv.id=major_disc_exp.member_id and major_disc_exp.exp_id like '%$majordis_exp'
inner join subspeciality_exp on cv.id=subspeciality_exp.member_id and subspeciality_exp.sp_id like '%$subspeciality_exp'
inner join country_exp on cv.id=country_exp.member_id and country_exp.country_id like '%$country_exp'
inner join language_exp on cv.id=language_exp.member_id and language like '%$language_exp'
left join regions_exp on cv.id=regions_exp.member_id and regions_exp.regions_id like '$regions_exp'
";
for ($i=0;$i<sizeOf($qualification_exp);$i++)
{
if ($i==0)
{
$q_cond=" where";
}
else
{
$q_cond=" or";
}
$query.="$q_cond qualification LIKE '%$qualification_exp[$i]' ";
}
$query.="and ( regions_exp.regions_id like '$regions_exp') ";
Is this any clearer? 🙂
As I said, it's the parsing of "multiple" selection data/fields into the URL? Is it possible? I've tried things like putting commas, i.e.
http://localhost/consultancy/adminsearchresults.php?majordis_exp=%&subspeciality_exp=%&country_exp=%&qualification_exp=1,3&language_exp=%®ions_exp=%&page=0&limit=10&col=surname&order=ASC
but this doesn't seem to work 🙁
Anyway, any suggestions? Or is it NOT possible?
Thanx for your help.
Regards,
Aaron