php - unexpected T_ENCAPSED_AND_WHITESPACE -
this question has answer here:
i have looked , can not tell error if 1 see not can point me in right direction fix here code
$con=mysqli_connect("localhost", $user_name, $password, $database_name); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select * `$table_name` energy < 30"); while($row = mysqli_fetch_array($result)) { $newenergy = $row['energy'] + 1; mysqli_query($con,"update $table_name set energy = $newenergy uuid =$row['uuid']"); } enter code here mysqli_close($con); ?>
change
mysqli_query($con,"update $table_name set energy = $newenergy uuid =$row['uuid']")
to
mysqli_query($con,"update $table_name set energy = $newenergy uuid ={$row['uuid']}")
for complex variables, need use {} syntax.
Comments
Post a Comment