mohammad abas mohammad abas - 3 months ago 9
PHP Question

Can't assign echo statement

I have this code:

<?php
$value = echo $row['balance'];
?>


And the mistake is in
$value = echo $row['balance'];
and I don't know how to fix it.

Answer

Your assignment is wrong:

  $value = echo $row['balance']; // no need to use echo

Remove the echo:

  $value = $row['balance']; 

Which would have thrown you a syntax error using error reporting.

Comments