Re: eval()



Mikro wrote:
How is the right way to use this function?

$p2ring3 =mysql_query("SELECT * FROM info where id_link='$id'");
while($rida125 = mysql_fetch_array($p2ring3))
{echo  "
<table border=1 width=100%>
<tr>
 <td>";
 eval(" ".$rida125["info"]."");
 echo"
 </td>
</tr>
</table>


You have syntax error in above code in line:
echo"

What you pass to "eval" function has to be correct PHP code. If you would like to echo some expression contained in $rida125["info"], then you shoud do something like:

eval( 'echo ' . $rida125['info'] . ';' );

or include "echo" and semicolon in the database field value
and do only:

eval( $rida125['info'] );


Hilarion .