【发布时间】:2016-03-08 13:02:30
【问题描述】:
$pos = $_POST['pos'];
$played = $_POST['played'];
$won = $_POST['won'];
$drawn = $_POST['drawn'];
$lost = $_POST['lost'];
$goalsfor = $_POST['goalsfor'];
$goalsag = $_POST['goalsag'];
$goaldif = $_POST['goalsdif'];
$points = $_POST['points'];
if (mysqli_query($db,"UPDATE division2 SET Pos ='".$pos."', played ='".$played."', won ='".$won."', drawn ='".$drawn."', lost ='".$lost."', goalsfor ='".$goalsfor."', goalsag ='".$goalsag."', goalsdif ='".$goaldif."', points ='".$points."', WHERE team = Treaty Celtic") === true) {
echo '<script language="javascript">';
echo 'alert("Row Successfully Inserted")';
echo '</script>';
include("index.html");
这是我目前所拥有的,但我不断收到“插入行错误” 我想在 php 中使用 $_Post 从用户输入更新整行。
【问题讨论】:
-
Errr...没有代码(还没有)。
-
你的代码在哪里?...
-
试试这个:WHERE team = 'Treaty Celtic'
-
刚刚尝试过 WHERE team = 'Treaty Celtic' 没用,谢谢@Azeez Kallayi