Mekaboo Posted November 7, 2021 Share Posted November 7, 2021 Hey😊 Trying to use this within my code: https://www.w3schools.com/php/func_mysqli_multi_query.asp I want text to be placed within this table Comment (Id, CommentId, Comment) so every time a form is submitted new words are shown. 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❤️ Link to comment Share on other sites More sharing options...
niche Posted November 7, 2021 Share Posted November 7, 2021 Glad to help, but what should you do first before inserting? 1 Link to comment Share on other sites More sharing options...
Mekaboo Posted November 8, 2021 Author Share Posted November 8, 2021 (edited) @niche Connect sql to proper table within DB Edited November 8, 2021 by Mekaboo edit answer Link to comment Share on other sites More sharing options...
Mekaboo Posted November 10, 2021 Author Share Posted November 10, 2021 SOLVED😊 Link to comment Share on other sites More sharing options...
niche Posted November 10, 2021 Share Posted November 10, 2021 Glad you solved you question. I went camping and didn't have any access. Didn't even see a desktop, pad or smartphone for two days Incredible! 1 Link to comment Share on other sites More sharing options...
Mekaboo Posted November 10, 2021 Author Share Posted November 10, 2021 @niche Sounds like Heaven😍. Would love to experience but my skin is so sensitive that cant be around nature long or I breakout☹️. I decided instead of doing multi query I separated the 2...this means either users can post images or post comment but not together. Its been difficult trying to combine the 2. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now