If statment not working

Posted on 2011-10-11
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

    verify that intval($rowUser->diff) is giving you the value that you expected, sometimes intval can give some unexpected results.

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now