Hey😊
Trying to use this within my code: PHP mysqli multi_query() Function but had trouble adding to code.
I want text to be placed within this table Comment (Id, CommentId, Comment) so every time a form is submitted new words are shown. Images change but everything else remains the same.
Form:
<form name="frmImage" enctype="multipart/form-data" action="" method="post" class="frmImageUpload">
<label>Upload Image File:</label><br/>
<input name="userImage" type="file" class="inputFile" /><br>
<label>Words:</label><br/>
<input type="text" id="commentid" name="commentid">
<br><br>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" value="Submit" name="submit">
</form>
DB Connect(want to place extra sql in here):
<?php
require_once "db.php";
$sql = "SELECT imageId FROM output_images ORDER BY imageId DESC";
$result = mysqli_query($conn, $sql);
// Loop thru comments and display all of them
while($row = mysqli_fetch_array($result)) {
printf("%s (%s)\n", $row["username"], $row["commentid"],$row["imageId"]);
?>
Result code:
<div class="row">
<div class="card h-100">
<h5 class="card-content"><?php echo $username;?> </h5>
<p class="card-content"><?php echo $commentid;?> </p>
<div class="card-footer">
<div class="card-footer">
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="card h-100">
<div class="card-header">
<h5 class="card-content"><?php echo $username;?> </h5>
<p class="alert-content"><?php echo $commentid;?> </p></div>
<img src="imageView.php?image_id=<?php echo $row["imageId"]; ?>" class="card-img-top" alt="...">
<div class="card-footer">
</div>
Thank ya❤️