php - Why is this bugging out? -
this question has answer here:
- php parse/syntax errors; , how solve them? 12 answers
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
Post a Comment