このコードを使用するとどうなりますか:
$emailc = 'thomas990428@me.com_classes';
$emaila = 'thomas990428@me.com_assignments';
$emailp = 'thomas990428@me.com_projects';
$resulty = mysqli_query($con,"SELECT * FROM `$emailc` ORDER BY period"); if (!$result) echo mysqli_error(); else // ok, do your thing.
$resulti = mysqli_query($con,"SELECT * FROM `$emaila` ORDER BY duehw"); if (!$result) echo mysqli_error(); else // ok, do your thing.
$resulto = mysqli_query($con,"SELECT * FROM `$emailp` ORDER BY dueproj"); if (!$result) echo mysqli_error(); else // ok, do your thing.
$classcount = 1;
while($row = mysqli_fetch_array($resulty))
{
$period = $row['period'];
$teacher = $row['teacher'];
$subject = $row['subject'];
$subjecto = strtolower($subject);
$subjecto = str_replace(' ', '', $subjecto);
$grade = $rowy['grade'];
echo "<section id='" . $subjecto . "'> \n";
echo "<p class='title'>" . $subject . "</p> \n";
echo "<a style='cursor:pointer;' onclick='homework" . $classcount . "()'>Homework </a>|<a style='cursor:pointer;' onclick='projects" . $classcount . "()'> Projects</a> \n";
echo "<div id='homework" . $classcount . "'><br /><a onclick='addassignment()'>Add Assignment</a><br />";
echo "<table class='homework'>";
echo "<tr>";
echo "<th class='title'>";
echo "Title";
echo "</th>";
echo "<th class='duedate'>";
echo "Due Date";
echo "</th>";
echo "</tr>";
while($row = mysqli_fetch_array($resulti))
{
$subjecthw = $row['subjecthw'];
$namehw = $row['namehw'];
$duehw = $row['duehw'];
echo "<tr>";
echo "<td class='title'>";
echo $namehw;
echo "</td>";
echo "<td class='duedate'>March ";
echo $duehw;
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "</div> \n";
echo "<div id='projects" . $classcount . "'><br /><a onclick='addassignment()'>Add Assignment</a><br />";
echo "<table class='homework'>";
echo "<tr>";
echo "<th class='title'>";
echo "Title";
echo "</th>";
echo "<th class='duedate'>";
echo "Due Date";
echo "</th>";
echo "</tr>";
while($row = mysqli_fetch_array($resulto))
{
$subjectproj = $row['subjectproj'];
$nameproj = $row['nameproj'];
$dueproj = $row['dueproj'];
echo "<tr>";
echo "<td class='title'>";
echo $nameproj;
echo "</td>";
echo "<td class='duedate'>March ";
echo $dueproj;
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "</div> \n";
echo "</section> \n";
$classcount += 1;
}
hw と proj は 1 つのセクションでしか取得できません。私はそれを間違っていますか?ありがとう!おそらくうまくいかないことはわかっていますが、どうすれば修正できますか?3 つのテーブルがあり、それらすべてからデータを取得する必要があります。