$t = '<a href=\"../'.($r['accounttyperaw'] == '') ? 'c' : 'u'.'/'.($r['accounttyperaw'] == '') ? $r['companytag'] : $r['feedusername'].'\">'.ucwords($r['feedfirstname'].' '.$r['feedlastname']).' has updated</a>';
Syntax Error
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Syntax Error
Why is my syntax off. PHP doesn't return an error.
Re: Syntax Error
Then your syntax is probably fine.unemployment wrote:PHP doesn't return an error.
What exactly is the problem ?
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Syntax Error
The a tag isn't echoing for some reasonjacek wrote:Then your syntax is probably fine.unemployment wrote:PHP doesn't return an error.
What exactly is the problem ?
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: Syntax Error
um. are you echoing $t?
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Syntax Error
Yes... still not workingbowersbros wrote:um. are you echoing $t?
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Syntax Error
I just made this for testing purposes but I can't get it to work. That's all the code.
$r['feedusername'] = 1; $r['feedfirstname'] = 2; $r['feedlastname'] = 3; $r['gender'] = 1; $r['accounttyperaw'] = ''; $r['companytag'] = 'stuff'; $r['feedusername'] = 'test'; $t = '<a href=\"../'.($r['accounttyperaw'] == '') ? 'c' : 'u'.'/'.($r['accounttyperaw'] == '') ? $r['companytag'] : $r['feedusername'].'\">'.ucwords($r['feedfirstname'].' '.$r['feedlastname']).' has updated</a>';
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Syntax Error
I figured out the solution to my problem. I needed more parenthesis.
$t = '<a href="../'.(($r['accounttyperaw'] == '') ? 'c' : 'u').'/'.(($r['accounttyperaw'] == '') ? $r['companytag'] : $r['feedusername']).'">'.ucwords($r['feedfirstname'].' '.$r['feedlastname']).' has updated</a>';