i have a problem here..
i have a submit form...with textboxes and a combobox...
the combobox contains a list of ID's like A1,B1 and C1...
let say i select A1 and click submit...
then the second form appear...
FYI,at the earlier submit form,i did a substr function after select the A1...
i want to cut only the "A"...
the purpose is at the second page,the A from the substr,will be used...
the second page contains a combobox with list of ID's like A2,A3,B2,B3...
so,when i choose A1 from the submit page,the combobox at the second page will allow me to choose only IDs starting with A...and same with B1 or C1..
and i have problem at the second page..
the combobox has nothing to choose...
i wonder whats wrong...
how to do this?
i mean how to do a substr at the first page,and then use the cut item to compare it with the other item at the second page?
substr(let say A)-->post to 2nd page-->use the A to display records starting with A only
do u understand what i'm trying to do?
sorry for my bad english...
i'm trying to talk here...
i wanna do substr to item taken from mysql...
heres my code snippet...
at the submit page..
Code:
//----------------------------------------------------
$query2 = "Select idMajor from ".$DBprefix." tPartMinor where idmajor <>'' group by idmajor order by idmajor";
$mesin = mysql_query($query2);
while ($dbq = mysql_fetch_array($mesin)) {
echo("<OPTION VALUE=$dbq[idMajor] selected>$dbq[idMajor]</option>\n");
$ayam=$dbq[idMajor];
$depan=substr("$ayam",0,1);
}
?>
</select>
</td>
</tr>
</table>
<br><br>
<center>
<input type="hidden" name="ID" value="<?=$referNum?>">
<input type="hidden" name="hariIni" value="<?=$datToday?>">
<input type="hidden" name="front" value="<?=$depan?>">
at the second page..i use the cut item from the substr function earlier...
Code:
$minor=@$HTTP_POST_VARS["front"];
.
.
.
.
. <select name="idMinor" size="1">
<option value="0">ID Minor</option>
<?php
//----------------------------------------------------
// Access Data From MySQL
// TABLE : tPartMinor
//----------------------------------------------------
$query2 = "Select LEFT('idMinor',0) from ".$DBprefix." tPartMinor where LEFT('idMinor',0)='$minor'";
$result2 = mysql_query($query2);
while ($dbq2 = mysql_fetch_array($result2)) {
echo("<OPTION VALUE=$dbq2[idMinor] selected>$dbq2[idMinor]</option>\n");
}
?>
</select>
but it seems i failed to do that...
what is the problem?
how to fix my code?pls help!!!!!!!!!!!!