出于某种原因,前两个查询不显示任何内容。我这样做了,你按下提交按钮发布你的输入,然后控制它并添加到数据库。但它没有用。
$sql = "SELECT * FROM rubrieklink WHERE rekeningnummer = '".$_POST["rekeningnummer"]."'";
$resultrubrieken = $mysqli->query($sql);
$sql="INSERT INTO betalingen(
bedrijf
,rekeningnummer
,prijs
,rubriek)
VALUES('".$_POST["name"]."'
,'".$_POST["rekeningnummer"]."'
,".$_POST["prijs"]."
,'".$resultrubrieken["rubriek"]."')";
$result = $mysqli->query($sql);
$resultbetalingen = $mysqli->query("SELECT * FROM betalingen");
if ($resultbetalingen->num_rows > 0) {
echo "<center><table><tr><td>bedrijf</td><td>rekeningnummer</td><td>prijs</td><td>rubriek</td></tr>";
while($betalingen = $resultbetalingen->fetch_assoc()){
echo"<tr><td>".$betalingen['bedrijf']."</td><td>".$betalingen['rekeningnummer']."</td><td>".$betalingen['prijs']."</td><td>".$betalingen['rubriek']."</td></tr>";
}
echo"</table>";
}
答案 0 :(得分:0)
rekeningnummer是一个INTEGER或一个字符串,如果是这样你必须引用你的字符串相同的插入例如$ _POST [“name”]没有引用 PS也为什么INSERT INTO在您的查询中加倍?