How can i show the only content that match the topic?
This code will show all the 'topic' and the 'content'
please help me
this is buzz(like a forum)
<thead>
<tr align="center">
<th>Topic</th>
</tr>
</thead>
<tbody>
<tr align="center">
<?php
$sql = "SELECT buzz_topic FROM buzz";
$result = $con->query($sql);
while($row = mysqli_fetch_assoc($result)) {
echo"<tr>
<td><a href='buzzContent.php'>{$row['buzz_topic']}</a></td>
</tr>";
}
?>
</tr>
<td><input type="button" value="Add Topic" onClick="document.location.href='addBuzz.php'"></td>
</tbody>
</table>
</form>
this is to add the topic and detail into the buzz database
<tr>
<td>Student ID</td>
<td>
<textarea rows="1" cols="50" type='text' name='student_ID' id='student_ID'></textarea>
</td>
</tr>
<tr>
<td>Topic</td>
<td>
<textarea rows="1" cols="50" type='text' name='buzz_topic' id='buzz_topic'></textarea>
</td>
</tr>
<tr>
<td>Content</td>
<td>
<textarea rows="5" cols="50" type='text' name='buzz_content' id='buzz_content'></textarea>
</td>
</tr>
</table>
<td><input type="submit" value="Submit" ></td>
<td><input type="button" onClick="history.go(0)" value="Cancel"></td>
</form>
this is to show the content of buzz that people are click, but it will show all the content and topic, how can i solve it?
<h1>
<?php
$sql = "SELECT buzz_topic FROM buzz";
$result = $con->query($sql);
while($row = mysqli_fetch_assoc($result)) {
echo $row['buzz_topic'];
}
?>
</h1>
<p>
<?php
$sql = "SELECT buzz_content FROM buzz";
$result = $con->query($sql);
while($row = mysqli_fetch_assoc($result)) {
echo $row['buzz_content'];
}
?>
</p>
<input type="button" onClick="document.location.href='buzz.php'" value="Back">
</form>