php - double quotes inside single quotes in MYSQL result? -



php - double quotes inside single quotes in MYSQL result? -

i'm trying basic can't figure out how.

basically i'm trying convert mysql result ($row) next format (literal strings):

"0784562627828" => "james", "0786636363663" => "david",

i have info stored in database , can them echoed on page so:

$phone = $row['phone']; $name = $row['name']; $list .=''.$phone.''; echo $list;

could please advise on this?

thanks

just assign them within array would:

$array = array(); while(your fetch here) { $array[$row['phone']] = $row['name']; }

to check contents, can utilize var_dump($array) or print_r($array)

or straight show them, 1 formatted:

while(your fetch here) { echo '"' . $row['phone'] . '"' . ' => ' . '"' . $row['name'] . '"' . '<br/>'; }

php mysql

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -