这是我的一些PHP:
$query = $db->prepare('SELECT * FROM villages WHERE owner = ? AND id = ?');
$array = array($_SESSION['id'], $_SESSION['viewing']);
$query->execute($array);
$r = $query->fetch();
$r['HQlevelPlusOne'] = $r['HQlevel'] + 1;
$logsNeeded = $headquartersRequired[$r['HQlevelPlusOne'][0]];
$logsNeeded 似乎不起作用,这是 $headquartersRequired 数组:
$headquartersRequired = array(array(50, 40, 55, 30),
array(90, 80, 100, 80));
例如,我如何将值称为“50”?假设在我当前的代码中 $r['HQlevelPlusOne'] 是 1。所以值 $logsNeeded 应该是 90 ..但它似乎不起作用..有谁知道为什么?