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!

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.