php - Why is this bugging out? -


this question has answer here:

error:

warning: mysqli_fetch_row() expects parameter 1 mysqli_result, boolean given in /home/iwatchdevelopers/public_html/emp/servadv/reasonofban.php on line 13

code:

<?php $name = $_get['name']; $con = mysqli_connect("", "", "", "");  // check connection if(mysqli_connect_errno()) {     echo "failed connect mysql: " . mysqli_connect_error(); } $query = "select reason bans username = " . $name; $result = mysqli_query($con, $query); $row = mysqli_fetch_row($result); if ($result === true){ echo($row['reason']);    }else{     echo("please notify sloss2003 bans broken.") } 

php syntax error:

change->

if $result== true then{    echo($row['reason']);    } 

to

if ($result === true){   echo($row['reason']);    } 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -