Questions tagged as 'mysql'

1
answer

How to get the number of rows affected in an insert in MySQL

In SQLServer I use after insert or update I use: SET @LINHAS_AFETADAS = @@ROWCOUNT So I get the number of rows affected, I would like to know the equivalent in MySQL, I searched the web but found only code solutions, I need to...
asked by 17.03.2015 / 17:04
1
answer

Total return of each order with MySQL?

Imagine that I have a pedidos table with the following fields: And that I have two other tables ( pedido_a , pedido_b ) of two distinct types of requests like the examples below: Each item in the pedidos...
asked by 04.08.2014 / 00:43
2
answers

PHP display image from mysql

I am developing a CMS where the user can insert articles and if you want to upload an image to that same article, the text uploads work correctly but the images do not, the only thing that appears is the name of the image in the site where the i...
asked by 08.04.2014 / 17:38
2
answers

Duplicate column value, how to avoid? [duplicate]

How do I do exactly so that this Valuation value column does not have its values duplicated, ie instead of four result lines there would be only two. SELECT p.nome, d.nome, c.valorAuxilio FROM sca_pessoa p INNER JOIN sca_dep...
asked by 08.04.2014 / 20:27
4
answers

SQL query that meets a parameter that is a set

I have the following situation: in a MEDICAL CONSULTATION I may have one or more SYMPTOMS. So I have a CONSULTA_SINTOMA table, making the connection between CONSULTA and SYMPTOM. A disease can be identified by one or more symptoms, so I have a t...
asked by 06.02.2014 / 14:23
1
answer

Uploading image with AJAX and PHP

I need a help to upload image with AJAX, PHP and MySQL It takes all the data right, even saves the path of the image in MySQL, however does not create the file in the destination folder, what I want is to move the image set in the destination fo...
asked by 17.12.2018 / 16:33
1
answer

Registering multiple images in a post

I have a study project that has to create a kind of gallery. Assuming I have a limit of 20 images per post. How to register these images in the database? I thought of two hypotheses. On the 1st I would create about 22 columns in a table calle...
asked by 16.11.2014 / 22:20
2
answers

How to give ALIAS with current "mes / year"?

Considering the query below, I need the ALIAS where the SUMS exists, stay as "current / current_name" ("ABR / 14", "MAI / 14" ...) dynamically. SELECT fornecedor.codigo, UPPER(fornecedor.razaosocial) AS fornecedor, FO...
asked by 19.11.2014 / 20:24
2
answers

How to use MySQL view's with Spring Data and eclipselink

In the development of my project I came across a select that will require a lot of application performance, since it consists in the use of two join's. Soon I came to mind creating a view in MySQL, but the problem is that I never used it consume...
asked by 19.11.2014 / 20:32
2
answers

How to change a query so that it is executed for each row of the X table?

I have the following database query working: SET @orderid := '1'; INSERT INTO 'cart_lines' ( 'line_id' , 'cart_id' , 'book_id' , 'book_reference' , 'book_name' , 'book_type' , 'unit_price' , 'quantity' , 'date_created' , 'date_updated' ) SEL...
asked by 26.12.2013 / 17:55