[Solved] Sign in form always showing “Wrong Credentials”

Your SQL query/logic is completely wrong. What you should do is check if that user and password combination exits in database using WHERE clause. But actually you are doing is fetching each row and checking for equality. In such situation you can also get n numbers of wrong credentials. $query = mysql_query(“SELECT * FROM table … Read more

[Solved] How can i used nested while loop ? in java

In your outer while loop you need this: overtime = 0; if (hoursWorked>8) overtime = (hoursWorked-8)*(rateOfPay*1.5) – (hoursWorked-8)*rateOfPay; // Calculate OVERTIME HOURS sets the overtime to zero for each iteration, and you’ll have to subtract the normal rate for overtime hours (otherwise you add them twice) and then you’ll have to add the overtime to … Read more

[Solved] Python 3.3.1 While Loops [duplicate]

You never update the value of GuessedNumber inside the loop. Therefore, if the code enters the loop, it will never leave it because RandomNumber != GuessedNumber will always be true. You need to do something like this: import random RandomNumber=(random.randint(0,100)) GuessedNumber=int(input(“Guess any whole number between 0 and 100! “)) while RandomNumber != GuessedNumber: print(“Unlucky guess … Read more

[Solved] OR and AND operator confusion in Javascript [closed]

If it helps you to understand, you can rewrite it from AND to OR: while (command != “quit” && command != “q”) { // do job } is equivalent to while (!(command === “quit” || command === “q”)) { // do job } https://en.wikipedia.org/wiki/De_Morgan%27s_laws 5 solved OR and AND operator confusion in Javascript [closed]

[Solved] I’m trying to make a very simple hangman program work. The while loop isn’t working [closed]

When the scanf(“%i”, &choice); statement is executed, it puts the integer entered by the user, into the int variable choice. However, it also leaves the newline character in the input buffer causing the user input to get thrown off. When the scanf(“%c\n”, &guess); statement is executed, the next character entered is placed on the input … Read more

[Solved] C# while loop not functioning [closed]

You need to split it up into sections. First: Get positive number double i; double k; Console.Write(“What is your total income : “); while (!double.TryParse(Console.ReadLine(), out i) || i < 0) { if (i < 0) { Console.WriteLine(“Your income cannot be negative.”); } else { Console.WriteLine(“Enter your income as a whole-dollar numeric figure.”); } } … Read more