ThomasJSmart
Programmer
- Sep 16, 2002
- 634
i need to get values from 2 tables out of a mysql database,
table1 = first
table2 = name
in my html form i have a select thing, i need the names from the database to apear in the menu as a single name.
so i made 2 variables
$n1 = $myrow[first];
$n2 = $myrow[name];
and put them in the option tag
<OPTION value='xxx'>".$n1." ".$n2."</OPTION>
this gave me a menu with a list of names,
option1 = James Peach
option2 = Lucy Cherry
option3 = Sally Apple
now the difficult part, the names are gotten from the "names" table and i need to submit this form into the "msg" table.
also i need the name that has been combined above to be seperated and put into seperate "firstname" "surname" coloms.
i tried to change the value field of the select option like this (the name of the select menu being "first":
<OPTION value='".$n1."&name="".$n2."'> but it wouldnt work.
any help appreciated,
thnks
Thomas
table1 = first
table2 = name
in my html form i have a select thing, i need the names from the database to apear in the menu as a single name.
so i made 2 variables
$n1 = $myrow[first];
$n2 = $myrow[name];
and put them in the option tag
<OPTION value='xxx'>".$n1." ".$n2."</OPTION>
this gave me a menu with a list of names,
option1 = James Peach
option2 = Lucy Cherry
option3 = Sally Apple
now the difficult part, the names are gotten from the "names" table and i need to submit this form into the "msg" table.
also i need the name that has been combined above to be seperated and put into seperate "firstname" "surname" coloms.
i tried to change the value field of the select option like this (the name of the select menu being "first":
<OPTION value='".$n1."&name="".$n2."'> but it wouldnt work.
any help appreciated,
thnks
Thomas