Page 1 of 1

Parse error: syntax error, unexpected on line 36

Posted: Sat Mar 13, 2010 8:59 am
by flyingcow93g
$matches = make_array(get_matches($teamnumber, {$event[0]["eventid"]}));

Parse error: syntax error, unexpected '{' in /home/flyingco/public_html/team_info.php on line 36

Can't figure out whats wrong with that...

code:

http://pastebin.com/XfunYQy1

Its my first time using php so its probably something stupid...

Re: Parse error: syntax error, unexpected on line 36

Posted: Sat Mar 13, 2010 10:02 am
by McInfo
When posting code, please use the syntax so it looks like this:

Code: Select all

$matches = make_array(get_matches($teamnumber, {$event[0]["eventid"]}));
To answer your question, remove the curly braces. Curly braces are used around variables only when they appear in strings.

Code: Select all

$matches = make_array(get_matches($teamnumber, $event[0]["eventid"]));
Edit: This post was recovered from search engine cache.

Re: Parse error: syntax error, unexpected on line 36

Posted: Sat Mar 13, 2010 2:54 pm
by flyingcow93g
Thanks.

Now,

Code: Select all

$yearevents[0]["eventid"]
is an array. I do I count the amount of "eventid" in it? I tried

Code: Select all

count($yearevents[0]["eventid]"))
but didn't get it..

Re: Parse error: syntax error, unexpected on line 36

Posted: Sun Mar 14, 2010 3:38 am
by cpetercarter
Just remove "{" and "}" from line 36.