Search Result

Collapse
12 results in 0.0026 seconds.
Keywords
Members
Tags
if statement
  •  

  • tharindu96
    started a topic Is this code correct
    in PHP

    Is this code correct

    can someone tell me if this code is correct i'm getting "not".
    Code:
    $query = "SELECT `id` FROM `users` WHERE `username`='$username' AND `password`='$passhash'";
    	if($query_run = mysql_query($query)) {
    			echo 'ok.';
    		}else{
    			echo 'not.';	
    		}
    See more | Go to post

  • James
    started a topic Error message not displaying
    in PHP

    Error message not displaying

    Hi there. I seem to be having a problem with an if statement within the following PHP code. I have a form which a user can fill in, in order to add house details to a database such as price, description and image etc. This PHP script throws up no errors when it is run and is working perfectly fine. However, the if statement I have used to display an error message if the user doesn't fill in all the fields isn't working. When I submit a blank form...
    See more | Go to post

  • Charles Ndethi
    started a topic How to return name of free lab from query?

    How to return name of free lab from query?

    Here is sample pseudocode to capture the logic.
    Attached is the sql export.

    if ( lab_sessiontime .Start_time > NOW())
    then lab is free for Start_time - NOW() minutes
    _______________ _______________ _______________ _______________ ____

    else if (lab_sessiontim e.Start_time < NOW() )
    then check if ( NOW() > lab_sessiotime. End_time
    if true then lab has been free for [NOW() - End_time]...
    See more | Go to post

  • Bill Sublette
    started a topic Microsoft Excel 2007

    Microsoft Excel 2007

    Okay so I know this isn't a question for MS Access, but this is as close as I could find for Excel. So here's my question:

    I have 2 pages set up with data pulling from one to populate the other. That formula works without an issue, but one formula seems to be kicking my butt. I need it to read a date on one page and when you put in that specific date it will then populate pre-filled data onto the first sheet. For example the second...
    See more | Go to post

  • wyzbs
    started a topic if Statement with multiple options

    if Statement with multiple options

    Hi,

    I'm wondering is there a way to shorten this IF statement:

    Code:
     if (a == b || a == c || a == d)
    {
    code
    }
    to
    Code:
     if (a == (b or c or d) )
    {
    code
    }

    Thank you
    See more | Go to post

  • Can IF or CASE statements be used to alter the criteria of a query?

    I am developing quite a large database in MS Access 2003.
    I need to allow the information to be filtered and displayed in a subform.

    I have several combo boxes that filter this query. These compare the combo box variable with the corresponding fields in another table. These work fine.

    The next step that I would like to do is allow the user to choose to show records if a certain field is blank (DatePaymentRec eived)....
    See more | Go to post

  • gmckay
    started a topic Using IF statement in a SELECT WHERE

    Using IF statement in a SELECT WHERE

    I have a table of updates that I wish to compare against the a database to find those records with differences.
    Each update record has a cat_id.
    Some updates have an alt_cat_id.
    I need a select to search to search if these differ, but only search for the alt-cat_id if it is populated. I don't have a solution for this but thought the IF statement might help.

    Code:
    SELECT upd.key, upd.cat_id, upd.alt_cat_id, db.cat_id
    ...
    See more | Go to post
    Last edited by Atli; May 17 '10, 01:42 AM. Reason: Added [code] tags.

  • abrown07
    started a topic How do I say not equal to more than one number?
    in C

    How do I say not equal to more than one number?

    I am trying to say if( my variable is not equal to 1 or 2)

    I would write

    if(variable != 1 ) but I do not know how to say or 2 in programming language?
    See more | Go to post

  • tasteofchaos
    started a topic If / else statement inside echo needed
    in PHP

    If / else statement inside echo needed

    Hey guys.

    Unfortunately I can't break out of an echo to run the if statement I want to run because it's pulling data for a certain row.

    I'd like text truncated to a certain amount of characters or a certain width but if the textual content is less than that amount of characters I want it untouched.

    My code so far is...

    Code:
    echo "</td><td class='listingtitle'>Artist:</td><td><a
    ...
    See more | Go to post
    Last edited by Atli; Dec 13 '09, 07:24 PM. Reason: Removed link due to heavy advertising.

  • EJaques
    started a topic If statement and LinkMasterFields

    If statement and LinkMasterFields

    Hello,

    I have a list box that controls the display of information on a form and its subform.

    I am having problems with the code to change Child/Parent links according to what is selected in the list box and a combo box (both on the main form):

    I want:
    -the subform to display only the records corresponding to a specific work order when a given order is selected in the list box
    -the subform...
    See more | Go to post

  • DAHMB
    started a topic Date Difference IF statement

    Date Difference IF statement

    I am trying to write a code that will:
    • check an employees date of hire field
    • compare it to todays date to get a years of service number
    • then check the emoployees rank
    • and if the rank equal 1 and the years of service is less then 1 then assign the value of 1
    • then look up 1 in the table tblOvertimeRate sOf Pay and assign the vlaue listed in column 2 of that table to the rate of pay field in my form.
    I know all this is vague but once I get...
    See more | Go to post

  • DAHMB
    started a topic Help with IF AND IF

    Help with IF AND IF

    I have a form that contains the following fields:
    EmployeeID
    OTDate
    HoursPay
    RateOfPay
    TypeOfJob
    Notes

    I am trying to write a code that upon lost focus of the Notes field will check the TypeOfJob field to see if its value is "Vacation" and if so to check the HoursPay field to see if its value is greater than 8 and iff so to create a new record copying the data of the current records EmployeeID,...
    See more | Go to post
Working...