Notice: Array to string conversion in C:\xampp\htdocs\tes1.php on line 19 -
i'm sorry if question may similar others question. success make connection database. i'll try show databases have. when tried code, got error.
<?php $servername = "localhost"; $username = "root"; $password = ""; // create connection $conn = new mysqli($servername, $username, $password); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } echo "connected successfully"; $sql = mysqli_query($conn,'show databases;'); $names = array($sql); foreach ($names $key => $value) { $row = mysqli_fetch_array($value); echo $row.'<br />'; } ?>
$sql = mysqli_query($conn,'show databases;'); $row = array(); while ($row[] = mysql_fetch_array($sql)) { print_r ($row) ; }
Comments
Post a Comment