well, this is what I'm trying to do...
I'm getting all the data from a row of a table into a list box.
On selecting a record in the list box, the corresponding records has to be displayed in the second list box.
And now, i have 2 text boxes where the user can enter some text and then can insert into the table.
In brief, i have 3 tables:thema, unterthema, artikel:
Thema(Thema_id, Thema_name)
Unterthema(Unterthema_id, thema_id, unterthema_name)
Artikel(artikel_id, unterthema_id, artikel_name, artikel_content)
So, at first, i'm displaying the records from thema_name in a list box.
Now, when the user selects the record, the second list box has to be filled with unterthema_name.
Now, the user can enter some text and it will be inserted into the fields(artikel_name and artikel_content).
I'm done upto here so far....
<?
//Db connection
$sql = "select * from thema order by THEMA_ID";
$result = mysql_query($sql);
?>
<form>
THEMA NAME: <? echo $Select1 ?><br>
<SELECT NAME="Select2" SIZE="1">
<?
while ($items=mysql_fetch_array($result))
{
?>
<OPTION VALUE="<? echo $items['THEMA_NAME']?>"><? echo $items['THEMA_NAME'] ?></OPTION>
<?
}
?>
</SELECT><BR>
</form>
<?
$sql = "select UNTERTHEMA_NAME from unterthema order by THEMA_ID";
$result = mysql_query($sql);
?>
<form>
<SELECT NAME="Select1" SIZE="1" onChange="javascript:document.forms[0].submit()">
<OPTION VALUE="none">-- please select --</OPTION>
<?
while ($items=mysql_fetch_array($result))
{
?>
<OPTION VALUE="<? echo $items['UNTERTHEMA_NAME']?>"><? echo $items['UNTERTHEMA_NAME'] ?></OPTION>
<?
}
?>
</SELECT><BR>
</form>
<form>
<input type="text" name="headline" size="50">
<br>
<input type="text" name="artikel" size="50">
<BR>
<input type="submit" name="submit" value="Insert">
</form>
<?
well, as of now, it just displays the records from thema_name and also unterthema_name.But; i want it another way, like select the thema_name, display unterthema_name.
Also, could somebody please tell me where should i place my insert st's?
Thanks everybody for helping me