https://code.sololearn.com/w4IoM4mu7BGb/?ref=app i have a problem in this part while ($row = $result->fetch_assoc() ) { echo "<h3 >" . "<i class='far fa-user'>" . " " . "hi," . $row['username'] . " " ."Welcome to the market for your touches" . "</i>" . "</h3>"; } Is not run please help me
7/16/2020 6:09:03 PM
Sarah Hasan10 Answers
New AnswerSarah Hasan seems then like your program works fine. Have you checked if the infouser table is not empty or if it contains any record with id of $idusers? If possible can you share your complete code or a more complete version of your code so I can know what $idusers is?
It is because mysqli_query does not return an object so you can not call fetch_assoc on null Change mysqli_query($conn, $sql) to $conn->query($sql)
I tried to replicate it in my machine and it works. Can you tell what errors exactly you are getting. If you are not getting any errors. Type the following in your code's first line <?php error_reporting(-1); ini_set('display_errors', 1); Only if you are not getting any errors
Well in that case what does your program print? If there is no error the response will be either 1. Data selected 2. No data 3. Data selected and "hi user, welcome to...."
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message