I need a help on how to fetch distinct numeric value in ORACLE DB,
So i have this command
$proj_result = oci_parse($conn, "SELECT DISTINCT THICKNESS FROM COMPONENT_CUTTING WHERE PROJECT_NAME = ':projectName'");
$getProject = $_GET['kode'];
oci_bind_by_name($proj_result, ":projectName", $getProject);
oci_execute($proj_result);
echo '<SELECT name="provinsi" class="cmb" id="provinsi" onChange="DinamisProvinsi(this);">'.'<br>';
echo '<OPTION VALUE=" ">'."- Select Thickness - ".'</OPTION>';
while($row = oci_fetch_array($proj_result, OCI_BOTH))
{
$PROJ = $row[THICKNESS];
echo "<OPTION VALUE='$PROJ'>$PROJ</OPTION>";
}
and on the DB, row THICKNESS is NUMBER(38) which is an INTEGER datatype.
The problem is i cant pull all the distinct value in thickness relative to the project name. Its only showing 1 value. it should show at least 2 distinct value.
Am I doing wrong in fetching the array ?
You should not put the single quotes around your named parameters . Remove them.
$proj_result = oci_parse($conn, "SELECT DISTINCT THICKNESS FROM COMPONENT_CUTTING WHERE PROJECT_NAME = :projectName");