Forums / General Questions / What is wrong with this one line of code??

What is wrong with this one line of code??

Views: 404

Results 1 to 2 of 2
7 Feb 2013, 2:00 PM
#1
tlyczko avatar

tlyczko

Zen Follower

Join Date:
Dec 2003
Location:
UPstate NY
Posts:
398
Plugin Contributions:
1

What is wrong with this one line of code??

My php editor claims there's an error in the area of the = sign next to pixel_trans.gif -- can anyone tell me what might be wrong with this line of code?? The editor says: 'Expression is not assignable: Infix expression"

    if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';

Thank you, Tom

7 Feb 2013, 2:37 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: What is wrong with this one line of code??

It looks like you've got a stray ! in front of the assignment statement, try the following instead:

 if (!$categories->fields['categories_image']) $categories->fields['categories_image'] = 'pixel_trans.gif';