Hi I have form like this at attachment , the problem i want to choose two or more choise for each book for example(book1--> economy and law) type of books from database table ,and books at another table i want to have these results 1---->law-Engineering 2---->law-Engineering-Economy
We'd need to know how you are storing the book info in the database (or is that part of the question) and how you want to store the results. It's pretty simple to get php to generate the html you require, whats harder is to make it usable by the people who have to process what gets entered.
database tables structure table(books) book_num|book_name|book_type --------------------------- 1 |bookno1 | 2 |bookno2 | 3 |bookno3 | table(booktype) num|type_name --------------------------- 1 |Engineering 2 |law 3 |Economy <? $sql= "SELECT * ". "FROM books"; $result=mysql_query($sql);?> <form name="myform" method="post" action=""> <table> <tr> <td >no</td> <td >books</td> <?$sql= "SELECT * ". "FROM booktype" ; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) {?><td><? echo ' '.$row['type_name'].' '; }?></td> </tr> <? while($row=mysql_fetch_array($result)) { ?> <tr> <td><? echo $row[book_num]; ?></td> <td><? echo $row[book_name]; ?></td> <? $sqlt= "SELECT * ". "FROM booktype"; $resultt=mysql_query($sqlt); while($rowt=mysql_fetch_array($resultt)){ $tname= $rowt[type_name]; ?> <td><input type="checkbox" name="typename[]" value=""></td><?}?> </tr> <?} ?> <tr> </tr> </table><input type="submit" value="save" id="save" name="save"></form> PHP: I want to save the results in this way book_num|book_name|book_type --------------------------- 1 |bookno1 |law,Economy 2 |bookno2 |Engineering 3 |bookno3 |law,Economy,Engineering