Questions tagged as 'mysql'

1
answer

get the sum of an attribute in sql

I have these two tables I want to get the sum of the states of all the users, for example user1: estado=1 user1: estado=0 user2: estado=1 user1: estado=0 user1: estado=1 user1: estado=1 user2: estado=0 user2: estado=1 I want the s...
asked by 08.01.2017 / 05:05
1
answer

SQL query that generates rows depending on quantity

I have a product table in MySQL, which stores the barcode and the stock quantity of a product. What I need is to generate an SQL query so that the rows can be repeated with certain information of a single product depending on the amount that...
asked by 11.01.2017 / 17:40
2
answers

Subtract product stock when making a Sale

I am working on a desktop application in Windows Forms and MySQL as a database manager. How do you rest in inventories when you make a Sale? That's the code I use for the save sales button. The data is added to a sale table, and the fi...
asked by 16.11.2016 / 16:34
2
answers

Error creating table in MySQL

I want to create a requested table in mysql, and it throws this at me: Executed SQL Statement: Create table 'deliverytrackingdb'.'pedido'( 'id' int(4) NOT NULL AUTO_INCREMENT, 'precio' double(5) NOT NULL, 'descripcion' varchar(200...
asked by 01.11.2016 / 22:42
1
answer

MySql tour of a CURSOR

How a CURSOR is run on MySql, that is, having the following code: DECLARE lc_prod CURSOR FOR SELECT pedi_prod_clave, prod_descripcion, SUM(vaca_toneladas) vaca_toneladas FROM scc_vales_carga, scc_pedidos, scc_productos WHERE vaca_tavi_numer...
asked by 04.10.2016 / 18:53
5
answers

How to send data from a modal bootstrap dialog to a table in mysql?

I have a table in mysql called jobs that has three fields (Job_id, Job_Name and Cost) which has data and I show them in this table in html Now what I want is that when selecting edit, I can modify the name and the cost and that this cha...
asked by 05.10.2016 / 19:32
2
answers

Error Undefined variable: mysqli_query

I do not list my data in a table, I do not know if I'm failing to call the query. The error is: Error Undefined variable: mysqli_query Code <?php include ("db/conexion.php"); $query = "SELECT * FROM infraccion"; $result =$co...
asked by 30.03.2017 / 20:05
2
answers

Message history with PHP, MYSQL and AJAX

I'm creating a kind of Imbox, a chat so to speak but with the difference is that I do not want it to be a general chat, where all users write and it appears to all, so I made the system reserved between two users similar to facebook, it works wh...
asked by 18.02.2017 / 18:33
1
answer

Is it possible to save data in a mysql database using a method?

Hello community, I am an apprentice in java programming and I would like to know if it is possible to register to bd MySql using a public string method, adding the property of the data to be stored in a bd MySql, sorry for the question...
asked by 07.10.2016 / 04:17
1
answer

How can I save the result of a query in an array using the MySQL stored procedure?

I want that when executing this query SELECT tabla1.campo1 From tabla1, tabla2 Where tabla1.campo1 = tabla2.campo1 Group By tabla1.campo1; Which will give me for example 600 records, save the 600 recor...
asked by 05.08.2016 / 20:40