+ 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>
5 Antworten
+ 4
There isn't any question!
+ 3
So, what is the question? 😁
+ 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.
+ 1
Database has connected but data is not echoing.