Questions tagged as 'sql'

1
answer

How can I paginate these results? [duplicate]

I made a SQL to filter results according to the desired parameters that resulted in the following statement: $query = $pdo->query("SELECT * FROM imovel ".trim($where, ' AND ')); Since I used PDO to mount the $query do I have to...
asked by 10.10.2014 / 14:34
2
answers

How best to insert an array into the database

I would like to know how to insert an array into a table in the database. I could use a foreach but I would like something performatic because I will work with a large number of data. foreach (var item in registros) { s...
asked by 07.04.2015 / 22:54
1
answer

Applying multiple image uploads

Hello, I have this code that generates in the case of multiple additives with everything I'm not sure how to make an image upload code to upload all the images that are placed in the FILE field of < strong> file [] could anyone help me to com...
asked by 12.04.2015 / 14:46
4
answers

What are the best practices for representing SQL within PHP code? [closed]

I've been programming PHP together with SQL (mainly MySQL) for a long time, I already have some experience, but I've never found a good solution for this: what is the best way to insert SQL into PHP code? Normally what people do is insert the...
asked by 04.02.2014 / 14:19
1
answer

Search by date range

HowtocreateaqueryfortheOracledatabasebyreturningalistofrequestsaccordingtoadaterange?Followthecodecurrentlyused:if(opcaoBusca.getSelectedIndex()==0){JOptionPane.showMessageDialog(null,"Escolha uma Opção de Busca!"); } else if (opcaoBusc...
asked by 12.01.2015 / 18:44
1
answer

Variable in the SQL query

Well, I'm trying to query with a variable I'm getting, but it's not working. Any suggestions? $model = $_REQUEST['model']; $customer = $_REQUEST['customer']; SELECT * FROM sistema WHERE concluido <> 1 AND site='$site' AND $model='X'    ...
asked by 21.07.2015 / 20:46
2
answers

Ignore point in a Query

I'm trying to run the following Query: select codigo from cliente where codigo ilike '%99.999.999%'; I found that by putting ilike , it would ignore everything, points and accents but I was wrong. In my system, I have a query scree...
asked by 31.07.2015 / 15:08
2
answers

Select with reference in several tables

I have three tables: PRODUTOS , PEDIDO and ESTOQUE , and I want to list all the inventory going by order and by product, as I show below: products codigo tipo medida 3020 | unico | 3 3021 | unico...
asked by 27.11.2018 / 17:52
4
answers

Search names in 2 different tables

I want to search 2 database tables where the name is equal to $nome variable. I would not like to gather data as if it were FK, but to pull all the information from these tables (other columns). administradores adm_id | nome | d...
asked by 21.11.2018 / 14:28
2
answers

UPDATE with two conditions

I would like to make a UPDATE where I have two conditions; wanted to put the two together in one, if not one is the other. FIRST: UPDATE RLT005 SET CtrDatBaixa = '2018-12-15 00:00:00' WHERE CtrDatBaixa BETWEEN '2018-12-15 00:00:00' A...
asked by 17.12.2018 / 18:53