+ 1
MYSQL Database
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
11 Answers
+ 1
Sarah 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?
+ 2
Sarah Hasan It's so nice to know that I was of help.
+ 1
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)
+ 1
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
0
Ore
No change I've tried before
0
yes there is no error
0
nothing happened
0
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...."
0
just print data selected
0
Ore thank you my problem is solved $idusers in the session have same name
0
I interested to know brefly about database