Questions tagged as 'mysql'

3
answers

Update in two columns, two tables

I have to update two columns in separate tables, but I do not know the commands very well, I would not like to use triggers. Will be updated around 100 records. Here is an example: Table a id nomes nota 1 SOen etc1...
asked by 15.06.2014 / 00:25
2
answers

Update HTML Table with PHP

I have a page that is giving select in php in a Firebird database and returning the result in table form. My interest is to update the prices of a table to quote price, how do I click on the cell and update the price and send it to the bank o...
asked by 27.07.2016 / 21:12
1
answer

Query to sort by two dates Mysql

I have my table tbl_noticias with two dates of type date : data_criacao_noticia and data_atualizada_noticia . The purpose is for the listing to be sorted as follows: If data_atualizada_noticia is different...
asked by 26.01.2015 / 19:00
1
answer

Count in two tables

I'm having trouble counting neighborhood items. I need to list all of the neighborhoods in City X and show the available cars and motorcycles items. In the example I just used a city for easy illustration. I used group by and left join...
asked by 31.01.2015 / 22:38
1
answer

Two conditions in SQL query with Laravel 4

I need to query MySQL with two conditions. I tried to do this: $query=DB::table('veteranos')->where('ra', '2300')->where('flag', 0)->pluck('ra'); In this way, the second condition is not working, that is, the query takes values oth...
asked by 21.12.2015 / 13:04
2
answers

Search with MySQL PDO in Array

I have this code: $whereBusca = "itaim-bibi"; $whereBusca = explode(',', $whereBusca); $sql = $pdo->prepare('SELECT id, nome, caminho FROM regiao WHERE caminho IN (:whereBusca)'); $sql->execute(array("whereBusca" => "'".implode("','"...
asked by 18.12.2015 / 14:11
1
answer

PHP function select 2 values

Good! I am creating functions in PHP with the aim of returning the difference between the date TIMESTAMP of the database and today's date, and for this I have created two functions: function getRegistos() { $query = "SELECT *, DA...
asked by 26.01.2016 / 13:21
2
answers

Calculation of Latitude and Longitude - Approximation

I'm having a hard time ... Currently I have the data Latitude and Longitude of company records in my database, with this I need to bring data close to me, in case I would have latitude and longitude of my position, for example, to bring compa...
asked by 08.07.2016 / 14:48
1
answer

Transactions does not work on structure creations / modifications?

I was searching the internet for some way to run Transactions for operations of type ALTER TABLE or CREATE TABLE in Mysql . This is because in a system of ours, we used Migrations and wanted that, if something went wrong in crea...
asked by 22.06.2016 / 16:43
2
answers

SUM in SELECT with LEFT JOIN being multiplied together

I have 3 tables in MYSQL. Account: id nome 1 caio 2 zé 3 marcelo Followers (the account id, that is, the user has 2 followers): idqual 1 1 2 2 2 3 Products (the account id, that is, the user caio has 3 products): idqual 1...
asked by 21.09.2015 / 21:27