mysqli $ result echosはうまく動作し、データベースに直接入力した場合に動作します(xampp。PHPバージョン7.1.4を使用)。
しかし、スクリプトでは常に結果を返すようです! - 種類の..
TEST1がトリガーされますが、TEST2はトリガーされませんか? TEST3はトリガーされません。
私のテストではTEST3だけが起動されるはずです。
だから何が壊れていますか?
-ThanksMysqliの結果が見つかりませんでしたが、データベースコンソールに直接入力したときに結果が見つかりません。 PHP7 XAMPP
for ($x=0; $x<count($TransArray); $x++) // for each entry in the array
{
$enterID = (string)$TransArray[$x][0];
$enterC = (string)$TransArray[$x][1];
$enterQ = (string)$TransArray[$x][2];
// Check to see if the CQID is in the fler_datatable with a matching language
// If so then we need to 'update'
// if not then we need to 'insert'
// NOTE : ‘cqid’ and ‘language’ make a unique value in the table
$result = mysqli_query($con,"SELECT rowID FROM fler_datatable
WHERE cqid='$enterID' AND itemid='SYS_DATA_TRANS' AND language='$LANG' LIMIT 1");
if ($result) // found it!
{
echo"<BR>TEST1";
while ($row = $result->fetch_assoc())
{
echo"<BR>TEST2";
$SetRow = $row['rowID'];
echo"<BR>Updatting translation entry on row ".$SetRow.".";
mysqli_query($con, "UPDATE fler_datatable SET class='$enterC', question='$enterQ' WHERE rowID='$SetRow'");
}
}
else // Not found
{
echo"<BR>TEST3";
echo"<BR>Adding new translation entry .";
mysqli_query($con, "INSERT INTO fler_datatable (cqid, class, question, itemid, language, date)
VALUES ('$enterID', '$enterC', '$enterQ' , 'SYS_DATA_TRANS', '$LANG', '$date')");
}
}
は、マニュアルをしてください読む...です。 –