Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<select name="school_name">

<option value="<?php echo $row[0];?>">

<?php $all= new student(); $all->selectSchool();?>

</option>

</select>

//php class

public function selectSchool()

{

$sch=mysqli_query($this->conn,"select * from school ");

while ($row = mysqli_fetch_array($sch))

{
echo $row[1];
}

}


What I have tried:

Quote:
The idea is that there are two tables for students data and the other for school data. When entering student data we select a school from the school table.

> there are two problems how to save these choices in the application table and the other problem The names of the schools to be selected
> appear in the same row.
Posted
Updated 22-Aug-18 18:18pm

1 solution

Quote:


echo "<option> $row1[1] </option>";



 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900