Hello friends, I have this serious problem regarding displaying data from database using php, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <form name="mainform" method="post" action="3_a.php"> <select name="course" onchange="document.mainform.rde.value = this.value"> <option value="12-01-2007">.NET</option> <option value="13-01-2007">J2ee</option> <option value="14-01-2007">PHP</option></select> <input type="text" name="rde" /> <input type="submit" value="submit"/> </form> </BODY> </HTML> Code (markup): I want to insert this values in the database and to display the same. Can any one suggest me how to write the code for this logic. Thanks,
There is nothing complicated in this. Needs just basic php mysql experience. Search for "php mysql tutorial" in google. BTW, why are you saving the same data in two form fields? ie, the textbox and the select has the same value stored in them.
http://forums.digitalpoint.com/search.php?searchid=3465675 Stop it now. You need to design your database in such a way that the start dates for each of your courses are stored indepndantly of any html and the person table, and when a user selects a course the start date for that course will already be available without any javascript or hidden values, then you can change that select box and remove all the value="*" tags from it so it defaults to the course name .........
Ok Krakjoe, Sorry for repeating the threads, I got the solution for the problem, I used an if statement to insert the date values in the database, for example, if($_POST['course']=='.NET') { $date='12-01-07') } Thanks.