より簡単な方法で次のことを実行できるかどうかを知りたいです。
$MyConn = new mysqli($host,$User,$Pass);
$TheKey = "...blablabla";
$QueryConvertedKey = "SELECT PASSWORD('".$TheKey."');";//Or SELECT YEAR(CURRENT_DATE);
$RsltCK = $MyConn->query($QueryConvertedKey);
//How to replace the while loop or if?
while ($NewRow = $RsltCK->fetch_row()) { //I think that I don't need to use a while or if for this.
echo "The Converted Key is:".$NewRow[0];
}
クエリの応答には必ず 1 つの結果が含まれているはずなのでwhile
、ループやif
句を使用する必要はないと思います。
1行のコードでwhile
andなしでこれを行うことは可能ですか?if