您好,我有以下while循环,该循环工作正常,除了一个值以下值是vag(在下面输出),当我什么都不返回时,它会返回“ lamborghini”
$sql2 = 'SELECT itempt_dim FROM dim WHERE id_dim = (SELECT iddimblg_rdim FROM rdim WHERE iddim_rdim =' . $id . ')';
$result2 = mysqli_query($con, $sql2);
while ($row2 = mysqli_fetch_array($result2)) {
$nomeparente = $row2['itempt_dim'];
}
$volkswagen = mb_strtolower($nomeid) . ' = {text: {name:"' . mb_strtolower($nomeid) . '"},' . ' image: "img/' . mb_strtolower($nomeid) . '.png", parent: ' . mb_strtolower($nomeparente) . '},' . '<br>';
print_r($volkswagen);
输出:
gallardo = {text: {name:"gallardo"}, image: "img/gallardo.png", parent: lamborghini},
espada = {text: {name:"espada"}, image: "img/espada.png", parent: lamborghini},
vag = {text: {name:"vag"}, image: "img/vag.png", parent: lamborghini (HERE!)},
volkswagen = {text: {name:"volkswagen"}, image: "img/volkswagen.png", parent: vag},
skoda = {text: {name:"skoda"}, image: "img/skoda.png", parent: vag},
seat = {text: {name:"seat"}, image: "img/seat.png", parent: vag},