Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これは簡単な修正であると確信しています.SQLクエリが肯定的な結果を返す場合は、コードブロックを実行したいと思います. 何かのようなもの:
if($query = mysqli_query($cxn,"[query]")) { Code to be executed if the query returns a positive result }
この形式を試しましたが、うまくいきません。私は以前にこれをやったと確信していますが、ここで壁にぶつかっています.
お役に立てれば幸いです。
つまり、クエリが失敗しないということですか? それから:
$query = mysqli_query($cxn, "[query]"); if($query !== false) { // Code to be executed if the query returns a positive result }