Questions tagged as 'sql'

1
answer

Select column Qt ComboBox

I have a Connect button in mainwindow.ui void MainWindow::on_pushButton_clicked() { ConectarDB = QSqlDatabase::addDatabase("QMYSQL"); ConectarDB.setHostName("localhost"); ConectarDB.setDatabaseName("Banco"); ConectarDB.setPort(...
asked by 03.04.2017 / 09:04
1
answer

Check multiple Radio type input in one simulation

Well, I'm creating a website and I need to validate the input radio fields. I thought about using JS, but it did not work. As said in the topic, there are several fields that I need to validate. follow the code that I have to validate: <...
asked by 16.03.2017 / 06:12
0
answers

Insert sql with rule WHERE NOT EXISTS does not work

This insert below only works until the first "Where" rule then does not work anymore Example WHERE descricao ='$ccusto' // funciona perfeitamente. Mas se uso o where abaixo WHERE descricao ='$ccusto' AND id_transfer ='$id_transfer' AND id...
asked by 22.02.2017 / 03:13
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
1
answer

Arrange column Period in SQL in ascending or descending order

Personal I have the following question / problem I'm doing a select on some accounts and organized by filename, but I need to organize for the period but I'm not getting it because it's not a single date. I can not use the creation date. M...
asked by 08.03.2017 / 18:58
2
answers

Sum of fields for input

Good morning, I have the following: <div class="form-group col-md-2"> <label for="campo4">Valor da Peça</label> <input type="text" class="form-control" name="customer['valor_venda']"> </div> . .          ...
asked by 16.02.2017 / 12:06
1
answer

update of rows followed according to selected items in listview

We have a table 1, which has building and rooms, building A, room01, room 02 ...., we need to put people in these rooms. These people come from another table (2), which populates the listview. This lvi has checkboxes and is multiselect. What are...
asked by 06.02.2017 / 23:12
1
answer

I need to display a TOTAL field in a PIVOT query

I have the query below that returns the total quantity in stock of the products for each city. Each city is a column and the products are displayed in rows. Now I need to display in a field (column) the sum of the total quantity of each city,...
asked by 15.02.2017 / 17:54
0
answers

How to install sqlsrv driver in pdo?

How do I install or sqlsrv driver in pdo? <?php function conectar(){ $pdo = null; try { $opcoes = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $pdo = new PDO("sqlsrv:server;host=192.168.0.30\COMPASS;dbname=weset;", "sa","...
asked by 22.02.2017 / 21:01
1
answer

Rails and simple_form, filter values to populate a combobox

There are three tables, one called company , another group and a subgroup call, / em> , a form, in this form I use simple_form to show a combobox with groups, but all come the groups and need to filter the groups of each company, how to do...
asked by 20.02.2017 / 13:52