通过echo输出输入值

sol*_*mon 0 html php mysql input

<input type="text" name="prod_id" value="<?php echo $product['table']['id']; ?>" />
Run Code Online (Sandbox Code Playgroud)

但它没有显示任何东西,虽然$ product变量肯定已经正确初始化,可能是什么问题?

这是print_r产品

Array ( 
    [0] => Array ( 
        [product_table] => Array ( 
            [id] => 5 
            [quantity] => 20 
            [name] => something 
        ) 
    ) 
) 
Run Code Online (Sandbox Code Playgroud)

Pra*_*ram 5

您必须访问变量,$product[0]['product_table']['id']而不是$product['table']['id']