Jump to content

Archived

This topic is now archived and is closed to further replies.

akirahz

A simple problem for the programmers i bet

Recommended Posts

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 13

here 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!

Share this post


Link to post
Share on other sites
What's in $arr[0]? The error is in line 13 of whatever is in $arr[0].

Ken

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.