Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Larry Garfield
On 3/11/13 6:25 PM, Angela Barone wrote: On Mar 11, 2013, at 4:10 PM, Jonathan Sundquist wrote: the variable $current_page does not exist. That was my problem. :( I've been staring at this for too long. Too bad there's not a 'use strict' pragma. There is. Always set your developm

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Angela Barone
On Mar 11, 2013, at 4:10 PM, Jonathan Sundquist wrote: > the variable $current_page does not exist. That was my problem. :( I've been staring at this for too long. Too bad there's not a 'use strict' pragma. > I would also suggest keeping with your original statement to return early an

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
Angela, the variable $current_page does not exist. so $curent_page does not equal $saved_page. Also the ! in front of the entire statement means that all of this is false. Since one items is true and not true = false "Don't save" is echoed out. If you are looking to save the results based on th

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Angela Barone
On Mar 11, 2013, at 3:47 PM, Ashley Sheridan wrote: > if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and > ($current_dt < ($saved_dt + 3600)) ) ) Hello Ash, This makes sense to me, but I can't get it to work, so I'm either not understanding it or I'm asking the wr

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
What you have if ( ($current_page == $saved_page) and ($current_ip == $saved_ip) and ($current_dt < ($saved_dt + 3600)) ) { return; } else { $query = "UPDATE `table` SET `hits` = '$count', `agent` = '$agent', `ts` = '$date_time' WHERE `page` = '$page'"; $result = mysql_qu

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Angela Barone
On Mar 11, 2013, at 2:38 PM, Jonathan Sundquist wrote: > Since you already have the return statement with the if statement the else > isn't required. If those three statements are true you would exit the call > any ways I don't follow. The else contains the meat of the statement. Ang

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Ashley Sheridan
On Mon, 2013-03-11 at 16:38 -0500, Jonathan Sundquist wrote: > Since you already have the return statement with the if statement the else > isn't required. If those three statements are true you would exit the call > any ways > On Mar 11, 2013 4:33 PM, "Angela Barone" > wrote: > > > I'm

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
Since you already have the return statement with the if statement the else isn't required. If those three statements are true you would exit the call any ways On Mar 11, 2013 4:33 PM, "Angela Barone" wrote: > I'm looking for an 'unless' statement, but as far as I can tell, > PHP doesn't h

[PHP] UNLESS Statement Equivalent

2013-03-11 Thread Angela Barone
I'm looking for an 'unless' statement, but as far as I can tell, PHP doesn't have one. Hopefully someone can help me rewrite my statement. In English, I want to say: "always do something UNLESS these 3 conditions are met". The best I've been able to come up with in PHP