I was wondering how I can store values in an Array, because I can just echo the $row['Name'], but if I want to store multiple values in array I get nothing.
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if (!$conn) {
die ('Failed to connect to MySQL: ' . mysqli_connect_error());
}
$sql = "SELECT * FROM " . $dbname . " WHERE id ='$id'";
$query = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($query)) {
$thisArray[] = array( $row['Name'],$row['accountNumber']);
}
echo $thisArray[0];
$thisArray =array();before start of the loop and useprint_r$thisArray[0]is itself an array, so you should useprint_r($thisArray[0]);