Where is the problem in my eval code??? because Apache said:
Parse error: syntax error, unexpected T_STRING in E:\xa开发者_如何学JAVAmpp\htdocs\1php\mas_res\inc\mysql_class.php(120) : eval()'d code on line 1
my code:
            $type1 = "row";
            $query1 = mysql_query("SELECT * FROM table");
            $textToEval = "mysql_fetch_{$type1}($query1);";
            $query = eval($textToEval);
And what is the correct mode??
Thanks ..
Don't use eval! Use PHP's variable functions:
$function = 'mysql_fetch_' . $type1;
$query = $function($query1);
Oh, and if you want to know, what was the fault: You forgot to escape the $ in $query1. It should be \$query1.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论