Questions tagged as 'if'

1
answer

Why does not print return all items in a list?

The following code should return all cars from the following list: cars = ['audi','bmw','subaru','toyota'] for car in cars: if car == 'bmw': print(car.upper()) else: print(car.title()) But just returned: BMW Toyota What'...
asked by 12.06.2018 / 02:37
3
answers

Can I use a SELECT within the IF?

It occurred to me that I tried to do this, but it seems to be wrong. Is it possible? //EVITANDO DUPLICIDADE if ($legenda > "0") { SELECT legenda FROM aula_upload_arquivo WHERE legenda = $legenda; echo 'Existe esse arquivo'; } else {...
asked by 04.12.2018 / 21:29
2
answers

PHP: If result with Function

I'm having a little problem using If with a function to show a result. function estaParaExpirar($data, $dias){ return(strtotime($data) < strtotime("+".$dias. "days") ); } if (estaParaExpirar($row[11], "10") || estaParaExpirar($row[12]...
asked by 11.08.2014 / 13:56
1
answer

Android Studio app

I'm developing an application that is a chord dictionary for guitar. And as there are countless chords, consequently I have countless Activities. The problem is that the application will be very, very large, because you are using the buttons and...
asked by 04.01.2017 / 00:47
1
answer

I have a script that I enter the number of months and returns me the deadline date. But I need to decrease one day of the result

Dev's good afternoon! I'm trying to create a script that calculates the end date from an initial date and its deadline in months. Ex: Starting date: 08/01/2018 Deadline: 60 months End Date: 7/31/2023 (60 months - 1 day) function calcDate...
asked by 20.08.2018 / 22:55
1
answer

If you can run other undesirable lines [closed]

I want to make a program that allows you to manipulate and manage information about CDs that is stored in a text file. The file should save for each CD, author / group name, CD name, year of edit, publisher name, total time (in minutes) and n...
asked by 14.10.2016 / 18:29
1
answer

syntax error, unexpected 'if' (T_IF) [closed]

What is the error? $sql = "SELECT item1, item2, item3 FROM tab_exemplo WHERE" if (isset($item3)) {echo 'quartos LIKE :A';} if (isset($item2) || isset($item1) || isset($item4)){echo 'AND'} if (isset($item4)){echo 'garagens LIKE :B';} if (isset...
asked by 21.08.2016 / 23:51