Ask the great God to instruct twos
Database connection
$rs = mysql_query ("Select Id,degree,min,max,prize,v from Magic_config");
while ($r = Mysql_fetch_assoc ($rs)) {
$prize _arr[] = $r;
}
Print_r ($prize _arr);
Look, it's coming out.
Array (
[0] = = Array ([id] = 1 [Degree] = 1 [min] = 1 [MAX] = 5 [prize] = First Prize [v] + 1)
[1] = = Array ([id] = 2 [degree] = 122 [min] = [MAX] = [prize] = Second prize [v] = 1))
But what I want is
$prize _arr = Array (
Array (' ID ' =>1, ' degree ' =>1, ' min ' =>1, ' Max ' =>5, ' prize ' = ' first prize ', ' V ' =>89),
Array (' ID ' =>2, ' degree ' =>32, ' min ' =>7, ' Max ' =>35, ' prize ' = ' Don't Lose heart ', ' V ' =>1);
What should I do?
------Solution--------------------
You use Var_dump ($prize _arr)
------Solution--------------------
Print_r ($prize _arr); Have
Array (
[0] = = Array ([id] = 1 [Degree] = 1 [min] = 1 [MAX] = 5 [prize] = First Prize [v] + 89)
[1] = = Array ([id] = 2 [degree] = [min] = 7 [MAX] = [prize] = = Do not lose heart [v] = 1)
)
Var_export ($prize _arr); Have
Array (
0 = = Array (' id ' = + 1, ' degree ' = + 1, ' min ' = + 1, ' max ' = 5, ' prize ' = ' first prize ', ' V ' = 89,),
1 = = Array (' id ' = + 2, ' degree ' = +, ' min ' = 7, ' max ' = ' = ' prize ' = ' Don't Lose heart ', ' V ' = 1, '),
)
It's just a different display format, and it doesn't change the value of $prize _arr.