Questions tagged as 'mysql'

1
answer

Adding multiple items

I would like to know how I can make this my code work to insert data in MySQL multiple. In the first file apply a repetition of 5 items, the problem is that I do not know if I made the right 2 file that is not inserting the data in SQL. I nee...
asked by 08.04.2015 / 07:54
2
answers

Foreach with database records

In my database I have a table called cadastroatendo within this table I put the days of service. I'm retrieving the data through foreach ... which in turn array returns this result: [listaAtendo] => Array ( [0]...
asked by 10.07.2015 / 21:49
2
answers

SELECT with CASE runs in phpMyAdmin but not passing in PHP

I have a problem with a SQL that runs perfectly in phpMyAdmin, but does not rotate passing the query to the database by PHP. Query copied from phpMyAdmin's SQL field: SELECT 'idforma_pagamento', 'habilitado', 'descricao', CASE forma_pagamen...
asked by 14.04.2015 / 16:24
1
answer

Make an update of several fields and values in the same table

I'm making a very simple inventory control system, and in the edit part of the products, I'm doing it this way: I query in a database, and clear text fields with the name of the products and the respective quantity , as in the attached image: In...
asked by 15.07.2015 / 00:11
2
answers

Remove last item from table and reset a new item above first

How would I remove the last item from a table by selecting the recent four. Ex: +-----------------+--------+ +------ ITEM -----+-VALOR--+ +--------------------------+ 1: FulanoA + está online 2: FulanoA + está ausente 3: Fula...
asked by 16.07.2015 / 18:55
2
answers

Query to return only the highest values

I have the following table:    Contract | Privacy Policy | Year   13 7800 2015   12 7800 2014   12 7800 2013   12 7801 2016   12 7801 2013   12 5102 2017 I'm trying to do a query to return the result below, ie the biggest "year" for...
asked by 01.03.2015 / 20:52
1
answer

How to fill null with value from the previous line?

Looking at the following table, I want to fill in the value that is null with the value of the previous line, what is the best thing to do with mysql?     
asked by 21.10.2015 / 16:03
1
answer

Edit records of a clientdataset of fields coming from a join

I have a simple example, but in three layers, with sqldataset + datasetprovider + clientdataset. I do not load any fields in the sqldataset. In the datasetprovider I leave the updatemode in upwherekeyonly. In the datasetprovider I leave allow...
asked by 24.02.2015 / 07:06
1
answer

Relate named ID in the same table

I need some help. I have a category table that has the fields: id; name; description; id_category_name; id_user; I want to get the category name when the category_id id is equal to the category id. Example: The category C...
asked by 18.02.2015 / 12:08
1
answer

Check all just select the first value of foreach

I tried to do a test of the submit that deletes the scenes only to appear when clicking on the checkboxes, but the same thing happens, it only appears if you select the first one. But if you select the first one and a few more it delete...
asked by 30.01.2015 / 19:39