search

Home  >  Q&A  >  body text

About mysqli_ferch_assoc() method


$result=mysqli_query($sql,$con)

if($row=mysqli_fetch_assoc($result){}

Why is the if condition not executed?

杨先生杨先生2587 days ago1349

reply all(3)I'll reply

  • 似火年华

    似火年华2018-02-14 16:48:43

    Is that a comma or a comma?

    reply
    0
  • 寻觅 beyond

    寻觅 beyond2018-02-02 16:27:52

    If no error is reported, it means that it has been executed.

    You can print the contents of $result. Also,

    Are you sure that the two parameters of your mysqli_query are not misplaced? ? ? ? ?

    reply
    0
  • phpcn_u102945

    phpcn_u1029452018-01-28 16:59:39

    if($row=mysqli_fetch_assoc($result){}

    There are missing brackets, you should see the system prompts to find it!

    Correct: if($row=mysqli_fetch_assoc($ result)){}

    reply
    0
  • 杨先生

    Hello, I didn’t include the brackets when I wrote the question, but they are there in the code.

    杨先生 · 2018-01-28 17:01:36
    杨先生

    What I am doing is making a judgment in the login verification. He does not make a judgment and just jumps down.

    杨先生 · 2018-01-28 17:02:41
  • Cancelreply