akirahz Posted September 10, 2006 Share Posted September 10, 2006 i was wondering, i cant seem to figure out whats wrong with my array line, i get this error:Parse error: parse error, unexpected T_STRING in /homepages/8/d155646242/htdocs/passion/inc/modules.inc.php(152) : eval()'d code on line 13here is the code it is reffering too $res = db_res("SELECT `Conf` FROM Modules"); while ( $arr = mysql_fetch_array($res) ) eval($arr[0]);anyone know what i got wrong in here? any help is appreciated, thanks! Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/ Share on other sites More sharing options...
kenrbnsn Posted September 10, 2006 Share Posted September 10, 2006 What's in $arr[0]? The error is in line 13 of whatever is in $arr[0].Ken Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/#findComment-89210 Share on other sites More sharing options...
akirahz Posted September 10, 2006 Author Share Posted September 10, 2006 um , im not sure - would it be line 13 of that file? or something else? Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/#findComment-89219 Share on other sites More sharing options...
.josh Posted September 10, 2006 Share Posted September 10, 2006 instead of eval'ing it, echo it out so you can look for the parse error. the code that eval is trying to run probably has a missing quote or semicolon or some other such thing in it. Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/#findComment-89221 Share on other sites More sharing options...
akirahz Posted September 10, 2006 Author Share Posted September 10, 2006 [quote author=Crayon Violent link=topic=107513.msg431482#msg431482 date=1157871671]instead of eval'ing it, echo it out so you can look for the parse error. the code that eval is trying to run probably has a missing quote or semicolon or some other such thing in it.[/quote]im really not that great at php, how would i echo it, how would the code look exactly? Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/#findComment-89223 Share on other sites More sharing options...
jefkin Posted September 11, 2006 Share Posted September 11, 2006 to echo it, change this:[code]while ( $arr = mysql_fetch_array($res) ) eval($arr[0]);[/code]to this:[code]while ($arr = mysql_fetch_array($res)){ echo "<pre>{$arr[0]}</pre>\n"; eval($arr[0]);}[/code]It will still die at the same place, but your ouput should include a bunch of *whatevers* you keep in 'Conf' field in the database table Modules.when it dies, look at the last output before the death, and count down to line 13... That's your error.Jeff Link to comment https://forums.phpfreaks.com/topic/20269-a-simple-problem-for-the-programmers-i-bet/#findComment-89581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.