Questions tagged as 'mysql'

1
answer

Result of a SELECT to use in another SELECT?

I know the title is a bit confusing, but I'll explain it here: I have a select, which displays to me the stores that have a promotion ( CONSULTATION 1 ): SELECT * FROM empresas INNER JOIN promocoes ON empresas.id = promocoes.id_empresa WHER...
asked by 02.07.2017 / 04:35
1
answer

Sorting a list by the current time and the next dated records

I have the following table containing the programming of the day of the week "Sunday" of a radio: (id, program, description, time_ini, end_time, link) I want to get the first 3 programs using the current time as a reference.     
asked by 01.05.2017 / 00:41
1
answer

Problem when performing update

I have on the site the system to register, list and edit users. Registering and Listing are ok, however, when trying to update a record, it does not change in DB and also does not return any errors. I already checked the connection and...
asked by 27.04.2017 / 22:13
2
answers

query sql does not work

My system is generating a query from a filter. All the query that I use in a given field can find nothing, both simple and query . select * from prt_license WHERE organization_type = 'commercial'; //testei na ide de banco de dados e da ret...
asked by 25.04.2017 / 19:09
1
answer

how to stop the for loop in a given action?

I have a problem with a form that uploads photos and saves the name in the database and moves the files to the specified folder. The problem is that the loop always repeats 5 times if I insert 5 photos. normal the photos are saved in the bank an...
asked by 14.05.2017 / 22:11
2
answers

Are there limits on the use of logical operators in the MySQL query?

Well, I would like to know if there are limits to the number of logical operators I can use in a MySQL query, for example: $sql = "SELECT * FROM usuarios WHERE nome = 'Fulano' OR email = '[email protected]' AND id <> '1'"; I would also...
asked by 24.06.2017 / 04:30
1
answer

Error doing PHP delete using PDO class and object orientation

I am doing a delete on my form manut_usuario , below is my method to delete that is in class usuario.class.php ; public function DelUsu($id){ try{ $delUsu = "DELETE FROM usuario WHERE idu_usujport = :id ";...
asked by 23.06.2017 / 02:34
1
answer

How do I make the checkbox 'checked' after saving in the bank?

My checkbox are saving normally, however, when I leave the page and return, they are not checked. Clients.blade.php<body><formmethod="POST" action="/user/update/client"> <input type="hidden" name="id" value="{{...
asked by 30.03.2017 / 14:54
1
answer

Problems in searching for data by name, does not return anything

I'm having trouble fetching data by name. The following is the code. Thanks in advance. <?php include_once 'dbconfig.php'; ?> <?php include_once 'header3.php'; ?> <div class="clearfix"></div> <div class="containe...
asked by 29.03.2017 / 11:48
1
answer

PHP - Is it possible to do an INSERT INTO with php variables and more SELECT?

I need to get information from another table and append to another table with more info from a php variable I've been researching and some forms I've found was: INSERT INTO tabProdutos ( id, descricao, unidade, qtd, valor) VALUES (‘$id’, ‘ (SE...
asked by 05.06.2017 / 14:07