The teacher table has elements of teacher's name , position, userid and password. I want to replace the userid
with teacher's name in the another table named Subject
so that it is easier to refer. So how can I do it using PHP coding ?
<?php
include ('connection.php');
$data1 = mysqli_query($connect,"SELECT * FROM teacher");
while ($info1=mysqli_fetch_array($data1))
{
echo "<option hidden selected> -- Your Option -- </option>";
echo "<option value=$info1[userid]>$info1[name]</option>";
}
I expect to have the teacher's name as an option but it came out $info1[name]