php array from mysql

后端 未结 2 1822
说谎
说谎 2021-01-28 07:41

I\'m using PHP to get a value from MySQL. My table has this form:

COL1 = MAIL mail@mail.com
COL2 = NAME myname

and I\'m getting from the databa

2条回答
  •  不要未来只要你来
    2021-01-28 08:43

    From the manual

    mysqli_fetch_array() is an extended version of the mysqli_fetch_row() function. In addition to storing the data in the numeric indices of the result array, the mysqli_fetch_array() function can also store the data in associative indices, using the field names of the result set as keys.

    What you you're really looking for is mysqli_fetch_assoc()

    Returns an associative array that corresponds to the fetched row or NULL if there are no more rows.

提交回复
热议问题