my table paper_details appears with the keywords:-
m_rid l p-title l keywords
__ll______
3 l xxxxx l language; sex/gender differences; functional assymetry; fMRI
4 l xxxxx l language; sex/gender differences; functional assymetry; fMRI
20 l xxxxx l language; sex/gender differences; functional assymetry; fMRI
25 l xxxxx l language; sex/gender differences; functional assymetry; fMRI
26 l xxxxx l language; sex/gender differences; functional assymetry; fMRI
this is how the table appears. So to upload these keywords into the select boxes and to remove the duplicates, i need help.
this is how I have written the code for the selection of the keywords...
<?php
require("the_jewel.php");
$sql1="SELECT m_rid
FROM paper_exp_mod_con
GROUP BY m_rid
ORDER BY m_rid ASC";
$stmt1 = OCIParse($conn, $sql1);
OCIExecute($stmt1);
while ($temp = OCIFetch($stmt1))
{
$paper_id =OCIResult($stmt1, "M_RID");
$sql = "SELECT keywords
FROM schmitzs.paper_details
WHERE m_rid = $paper_id";
$stmt = OCIParse($conn, $sql);
OCIExecute($stmt);
while ($temp = OCIFetch($stmt))
{
$keyword1 = OCIResult($stmt, "KEYWORDS");
$keywords = explode(";",$keyword1);
$no_of_keywords = count($keywords);
for ($i=0; $i <= ($no_of_keywords - 1); $i++)
{
if(!isset($uniquekeywords[$keywords[$i]]))
$uniquekeywords[$keywords[$i]]=1; //Just set it with a value so it's set
}
//reset($keywords);
$keys = array();
$keys = array_fill(0,$no_of_keywords,key($uniquekeywords));
foreach($keys as $thekey)
{
echo "<option value='$thekey'>$thekey </option>";
echo "<br>";
}
}
}
?>
Thanks.