Welcome to Techno Smarter QA, Question, Answer forum. Ask questions, receive answers, or help someone. Join Now
Welcome to Techno Smarter Q&A, where you can ask questions and receive answers from other members of the community. Ask the Technical & Programming related questions that you want. Join our community and help others .
+3 votes

 It is working  but the subject and Choose, I want to place Combobox after RollNo & this is my code please check when I enter subject and rollno and obtained marks the result is not showing eg:- its shows roll no name obtained marks and not subject I send you my code please check

in PHP by (90 points) 3 18 31
edited by

1 Answer

0 votes

I answered you. You have to simply change the code like this -

Change <form></form> code -

form></form> code - 

<form action="" method="post" name="form1">

        <table width="25%" border="0">



                <td><input type="number" min = 1  name="RollNo"></td>




$cser=mysqli_connect("localhost","root","","test") or die("connection failed:".mysqli_error());

$result = mysqli_query($cser,"SELECT pname FROM crud2") or die(mysql_error());

if (mysqli_num_rows($result)!=0)


echo 'Subject Name : </td><td><select name="pname">

      <option value=" " selected="selected">Choose one</option>';

   while($drop_2 = mysqli_fetch_array( $result ))


  echo '<option value="'.$drop_2['pname'].'">'.$drop_2['pname'].'</option>';


echo '</select>';







                <td><input type="text" pattern="[a-zA-Z][a-zA-Z ]{2,}"  name="Name"></td>




                <td><input type="number" min = 1 name="ObtainedMarks"></td>




                <td><input type="submit" name="Submit" value="Enter"></td>




Change the PHP database name, column name.

This is form code.  Search form code inside the insert code and replace complete form code to this.

by (9.1k points) 11 25 63
It works, Thank you.
Please do not ask the same questions. You can discuss in the comment.
Change name to your table subject name.

<select name="pname">
shlulbe be

<select name="sujectcolumnname">
What is your column name for subject ?
Welcome. You can ask any question.
Follow the guidelines.
1. Ask unique questions. (Unlimited)
2. Do not ask the same question again. (Get solution on same question page no need to add another question base on the same question)

Ask me another question.

Best Regards -
Okay Bro Thanks