+ 2

php problem. Please tell me what's the problems in this code.

<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php $servername = "localhost"; $username = "jahed202"; $password = "jahed@202"; $dbname = "w3csoft"; // Create connection $conn =mysqli_connect($servername, $username, $password,$dbname); // Check connection if($conn=true){ echo "mysql successfully connected"; } else {echo "mysql is not connected";} // select query $sql = "SELECT fname, lname FROM my_usar;"; $result = mysqli_query($conn,$sql); // output connection while($mydata=mysqli_fetch_array($result)) {echo $mydata["fname"]; } ?> </body> </html>

10th Jun 2019, 7:29 AM
md jahed
md jahed - avatar
4 ответов
+ 4
There isn't any question!
10th Jun 2019, 7:41 AM
CodeFu
CodeFu - avatar
+ 3
So, what is the question? 😁
10th Jun 2019, 7:33 AM
River
River - avatar
+ 2
Can I ask where you got it from? Considering you have put it in <html> tags, I can only assume you are missing code.
10th Jun 2019, 8:10 AM
River
River - avatar
+ 1
Database has connected but data is not echoing.
10th Jun 2019, 8:34 AM
md jahed
md jahed - avatar