Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 12th Dec 2011, 02:03 PM   #1
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Help with PHP "If" statement needed
Share on: 
fb share twitter share gplus share more share

What is wrong with this code? It's breaking my page.

if ($i >= 35) $1 = 34 ;

I want $i to max out at 34

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Unread 12th Dec 2011, 02:24 PM   #2
HyperActive Warrior
War Room Member
 
Join Date: 2009
Posts: 145
Thanks: 3
Thanked 48 Times in 24 Posts
Default
Re: Help with PHP "If" statement needed
Share on: 
fb share twitter share gplus share more share

Going by what you typed:

if ($i >= 35) $1 = 34 ;

Should be

if ($i >= 35) $i = 34 ;

You have a variable of $1 instead of $i.

723Media is offline  
The Following User Says Thank You to 723Media For This Useful Post:
Unread 12th Dec 2011, 02:58 PM   #3
Grouchy Old Geezer
War Room Member
 
Kirk Ward's Avatar
 
Join Date: 2006
Location: Ellijay, GA, USA. (Talk about being in the woods!)
Posts: 673
Thanks: 279
Thanked 62 Times in 47 Posts
Default
Re: Help with PHP "If" statement needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by 723Media View Post

Going by what you typed:

if ( >= 35) $1 = 34 ;

Should be

if ( >= 35) = 34 ;

You have a variable of $1 instead of .
That would be a big OOPS.

I redid it and added brackets, so I'll bet I corrected it without even realizing the error.

I'm now using ...

if ($i >= 35) { $i = 34 ; }

and it is working. Don't know if the brackets helped or wer indifferent. I'm betting on the indifferent after viewing your solution.

I am so ashamed.

Sigh.

Thanks a bunch.

"We are not here to sell a parcel of boilers and vats, but the potentiality of growing rich beyond the dreams of avarice."

Dr. Samuel Johnson (Presiding at the sale of Thrales brewery, London, 1781)
Kirk Ward is offline  
Closed Thread


Bookmarks

Tags
help needed, needed, php, statement


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:08 AM.