Questions tagged as 'mysql'

1
answer

How to pass table field name mysql as parameter via PDO PARAM?

I have a form where the user defines some criteria for the system to search the data in a mysql database. Among the criteria, the user can choose two search options. These options are two fields of the table in that database. The data is sent...
asked by 14.11.2018 / 02:44
1
answer

Join or separate repeated columns in different tables

I created a tbl_users table. But I have Profissionais and Empresas that many columns are the same. Would it be interesting to use in the same table, or is it better to separate?     
asked by 18.05.2018 / 02:44
1
answer

List an item's accompaniments from a sale with mysql

Table 1 - sales sales_id Table 2 - order_order id | sales_id | id_pastel Table 3 - Tracking item id | id_item_pedido | id_accounting Example: I make a sale with two items and their accompaniments: A cake: meat (item_edited) Si...
asked by 11.04.2018 / 01:35
1
answer

How to catch mysql (duplicate entry) error and display a message on screen for the user, using codeigniter?

How to catch the error of mysql (duplicate entry) and display a message on the screen to the user, using codeigniter?    Error Number: 1062       Duplicate entry '123456' for key 'process'       INSERT INTO processo ( nprocesso...
asked by 02.05.2018 / 21:53
2
answers

Cross two tables and link the line one with another, forming a third

Good afternoon, fellow programmers. I came across the following problem: I have two tables, one with applicants, and one with vacancies. I need a query that crosses the two tables, and get the first available slot and give it to the first req...
asked by 08.05.2018 / 18:40
1
answer

Function to allow only one vote for equipment

I set up a simple polling system in which you can vote only once per IP. However, it registers the IP of the network and not the user's computer, making it impossible for other equipment on the same network to vote. I already researched Google a...
asked by 03.05.2018 / 22:25
1
answer

I can not list a table in php

I can not list a simple table in php ... I do not see what's wrong with the code, when I run this php code it just shows me a blank page ... What am I doing wrong? <html> <head> <title>Listar Alunos</alunos> </he...
asked by 07.05.2018 / 20:30
1
answer

Remove accents from an array

I have a select in which it is populated through a query in the database: <select class="form-control" name="select_cidades"> <option>Selecione a Cidade</option> <?php $resu...
asked by 06.03.2018 / 19:26
1
answer

Select period between times

I'm trying to set up a sql to check if there is any record between informed times, but it's not coming out, I've done some tests but I have not been successful. For example, a bank record that contains these two times, as initial and f...
asked by 06.03.2018 / 00:37
1
answer

Put the euro symbol on a table

In my query I have two columns where I make the sum of hours and the sum of the amount to be paid by the client at these times: Line summing times: CAST(SUM(SEC_TO_TIME(E.teste1))/100 AS DECIMAL (15,2)) AS QTD 1º e 2º Hora Line t...
asked by 07.03.2018 / 11:47