Jump to content

A simple problem for the programmers i bet


akirahz

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!

[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?
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

Archived

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

×
×
  • Create New...

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.