I'm using PHP to get a value from MySQL. My table has this form:
COL1 = MAIL [email protected]
COL2 = NAME myname
and I'm getting from the database the row of the user.
$query = mysqli_query($conn, "select * from user where mail = '[email protected]'");
$row = mysqli_fetch_array($query);
print_r($row);
But my output is very strange, it gives my like a bidimensional array like this:
Array ( [0] => [email protected] [MAIL] => [email protected] [1] => myname [NAME] => myname )
I'm learning PHP and I'm wondering if is this supposed to be like this. Because I would want something more like:
MAIL => [email protected]
NAME => myname
Maybe I'm not getting this syntax very well, but this is why I'm looking for help. Thanks in advance
Thank you in Advance