[Last Call] Learn how to a build a cloud-first strategyRegister Now


If statment not working

Posted on 2011-10-11
Medium Priority
Last Modified: 2012-05-12
I cant figure this one out, at all so would appriciate any suggestions.

I have an if statment:-
				if (intval($rowUser->diff) > 1200);
					echo "Dont run me";

Open in new window

Now, $rowUser->diff = 523, so is obviosuly less than 1200 so shouldnt run, however it always does.

I put in the intVal to convert it from a string to a interger, but still same issue.

Any ideas?
Question by:tonelm54
LVL 13

Accepted Solution

haloexpertsexchange earned 2000 total points
ID: 36950290
verify that intval($rowUser->diff) is giving you the value that you expected, sometimes intval can give some unexpected results.

Author Comment

ID: 36950306
DOH, it was
if (intval($rowUser->diff) > 1200)
if (intval($rowUser->diff) > 1200);

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 23 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question