Questions tagged as 'mysql'

0
answers

Make two or more Select with Aliases in the query to generate a separate array

I have a single table of only one column with all the words in Portuguese. I want to make a Double or Triple Select and retrieve in every query all words with 'A' in the alias WordsComA, and all with 'B' in the Alias WordsComB. When I recover...
asked by 23.09.2017 / 01:31
0
answers

Update photos in php database

Good afternoon, I have a problem saving the image to the database. It happens that the image that I do update goes to the folder where it should, but in the database does not save neither the name nor the path, follow the codes below public f...
asked by 23.09.2017 / 21:35
1
answer

How to display image stored in blob type [duplicate]

I have a database that has a blob field. This field is for a photo. I need to call this photo and show it. Home I do not own the photos that gave rise to the contents of the database, so it is not feasible to work linking the address. I know i...
asked by 24.09.2017 / 00:01
1
answer

Problems adding foreign key in MySQL

I'm having trouble setting the anoAuto attribute of the business table as a foreign key to automovéis.ano. MySQL always says "ERROR CODE: 1215. Can not add foreign key constraint". create table automoveis ( codigo int, ano int, fabricante varc...
asked by 23.09.2017 / 23:19
0
answers

Error 1452 mysql: foreign key error

I have created two product tables with tbl_produto and tbl_adiciona , so instead of every time I want to update inventory, I do not have two equal data in the product table, but in an external table. <!-- language: lang-sql --&...
asked by 22.09.2017 / 21:13
0
answers

Error in a trigger in Mysql

create trigger GatilhoRecebimento after insert on recebimentos for each row begin update caixa set valorcréditos_caixa = valorcréditos_caixa + new.valor_receb where caixa.cod_caixa = recebimentos.cod_caixa; end $$ delimiter ; I'm not f...
asked by 22.09.2017 / 19:58
2
answers

Check if row in database exists, otherwise, restart query again

I have a database and I would always fetch the value before, and I have used it for example: I'll get a news, and on this page has a link to the previous news, and I'll search for it by searching for the current news id - 1, but in this way,...
asked by 22.09.2017 / 19:09
1
answer

Return value grouped by date

I have a table in MySQL , which stores the confirmations of my clients in my website, having as fields: id | cod_cliente | data , being the date the main. What I need is to group and return the result of the day. Example:    Das 0...
asked by 06.10.2017 / 23:59
0
answers

Encryption error when inserting data into the database

Well, I'm starting now and I'm trying to create a small form with PHP and MySQL that sends the form information to the bank, but I have a small problem. When I enter the data in the database, when I will see in the table the data are coding prob...
asked by 01.10.2017 / 18:31
1
answer

How to change the id of a column by name in the same table in MySQL?

I want to give a select and instead of receiving the top_default number I want the name of it that is nm_depto. How can I do this? SELECT d.id_numero_depto, d.nm_depto, d.id_numero_depto_superior FROM tb_depto AS d;     
asked by 09.10.2017 / 00:42