Jump to content


Photo

A simple problem for the programmers i bet


  • Please log in to reply
5 replies to this topic

#1 akirahz

akirahz
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 September 2006 - 06:00 AM

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!



#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 10 September 2006 - 06:22 AM

What's in $arr[0]? The error is in line 13 of whatever is in $arr[0].

Ken

#3 akirahz

akirahz
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 September 2006 - 06:50 AM

um , im not sure - would it be line 13 of that file? or something else?

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 10 September 2006 - 07:01 AM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 akirahz

akirahz
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 September 2006 - 07:03 AM

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.


im really not that great at php, how would i echo it, how would the code look exactly?

#6 jefkin

jefkin
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 11 September 2006 - 01:56 AM

to echo it, change this:

while ( $arr = mysql_fetch_array($res) ) eval($arr[0]);

to this:

while ($arr = mysql_fetch_array($res))
{
   echo "<pre>{$arr[0]}</pre>\n";
   eval($arr[0]);
}

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users