Questions tagged as 'select'

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

How to disable textarea when select is set to false

I would like to disable textarea if the select is false, and enable if the select is true. I was trying to do it for the DOM, but I did not succeed, here is the code I have, if anyone can help me. <div class="row">...
asked by 18.11.2018 / 00:48
3
answers

Category Sum and SubCategory with PHP and MYSQL

I have already broken my mind and am lost in how to find the solution to my problem, I am developing a financial report that has categories and subcategory (7 levels) Below the structure of part of my table and how is some data: Thereportwor...
asked by 22.10.2018 / 21:45
1
answer

I will create a select and would like it to update the number of records

I am creating a system and in the part of registering products in php to a select with the option of how many products are going to be registered, I would like q when choosing the select update to appear the number of lines for registration, how...
asked by 09.10.2017 / 08:33
3
answers

Blank space in PHP mySQL insert [closed]

I made inserts into the database with the following SQL: $pdo = db_connect(); $sql = "INSERT INTO 'alunos' ( 'matriculaAluno', 'nomeAluno', 'apelidoAluno', 'sexoAluno',...
asked by 02.02.2017 / 18:11
1
answer

SQL Database [closed]

Hello! I'm in training in Support and I'm having a hard time understanding the logic of select, I need to do script for example: bring the statuses of the Criteria table.     
asked by 30.08.2016 / 20:52
1
answer

Query MYSQL too slow, more than 25 seconds, how to improve?

I have a query in mysql that is very slow, more than 25 seconds. The base is quite large, something around 1,000 records of real estate (table osrs_properties) and 16,000 records of photos (table osrs_photos). The query without the photo t...
asked by 10.12.2018 / 13:18
1
answer

How to use select in a table that is not related?

I need to build a SQL query that lists the amount to be paid per km, the quantity used and the total amount to be paid for each lease It is a SELECT and inner / left join exercise but I do not know how to relate LOCATION to TABLE. Th...
asked by 28.09.2018 / 15:43
1
answer

WHERE clause with PHP coming from JavaScript [closed]

I need to pass a PHP variable into a WHERE clause of a SELECT , but this PHP variable receives a value from JAVASCRIPT . I ran a test passing just a native PHP value and it worked: <?php $phpNum = 1; /* Testando com numéric...
asked by 29.08.2016 / 02:13
1
answer

Error "Warning: mysqli_query () expects parameter 1 to be mysqli, null given" [closed]

I'm developing an API in PHP, which is hosted by Hostinger. However, when I do the SQL query in MySQLi, I get the same error, no matter what changes I make in the code: Warning: mysqli_query () expects parameter 1 to be mysqli, null given and...
asked by 30.11.2015 / 20:23