Questions tagged as 'sql'

1
answer

Only one product appears in the FPDF file as I do so that they all appear?

I have a sales page for a project and I have to pass the data of the cart to an invoice, I have the product and cart tables, and the id's of the products that were bought are stored in the cart. $query = mysqli_query($con,"select * from produc...
asked by 13.10.2018 / 19:19
0
answers

Help, why does the error: missing right parenthesis in Oracle?

I have the following query that shows me the name of RESPONSIBLE and ALTERNATE of a service the field TYPE RANGE, can have the values 1 or 2, where 1 = RESPONSIBLE and 2 = ALTERNATE SELECT E.NOMBRE_TRABAJADOR RESPONSABLE,...
asked by 08.10.2018 / 03:51
0
answers

Tell patients and family members affiliated with the plan

CREATE TABLE 'planes' ( 'codplan' int(11) NOT NULL, 'nomplan' text CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL, 'dirigido' text CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL, 'costoplan' float(12,2) NOT NULL, 'especactivas...
asked by 04.10.2018 / 02:13
2
answers

Insert in MySQL if there is no field

How can I insert one into MySQL only if there is no field? For example: INSERT INTO persona (nombre, apellidos, edad) VALUES ('Nombre', 'Apellidos', 25) WHERE NOT EXISTS (SELECT nombre FROM persona WHERE nombre = 'Daniel')     
asked by 08.10.2018 / 16:29
0
answers

error when saving an order detail in laravel, it tells me no existing column

I am using laravel to create an ordering system and when I save an order it generates an error: "message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'stock' in 'field list' (SQL: insert into 'detalle_pedidos' ('idpedido', 'idprod...
asked by 03.10.2018 / 21:05
1
answer

Repeated results when running a cursor in MySQL

I have a function in MySQL that has a cursor. For the comparisons in sybase you must return two results, but it returns 3 since the second one that returns repeats it. How can I solve it? I leave the code of the function: delimiter // creat...
asked by 02.10.2018 / 07:42
0
answers

Query does not bring me the expected data

I have a selection query SELECT which when I apply a filter with WHERE no longer brings me anything but without the filter if it brings me all the data. SELECT PC.ProductoCatalogoId, P.Nombre, PC.PrecioVenta, E.Nombre, O.NombreOp...
asked by 02.10.2018 / 10:13
1
answer

Edit data from a sql table in a table in html

I only have one question. But first, thanks for the help in the previous question. Is there a way to edit the sql data in an html table? I already managed to make them appear, what I want to do now is that they are editable and the changes ar...
asked by 28.09.2018 / 17:12
1
answer

Print random field from a database

I have a small problem I have a functional code which generates a random word $codigo = mysql_query("SELECT * FROM palabras WHERE categoria='b'"); mt_srand(time()); $max = mysql_num_rows($codigo); $rand = mt_rand(1,$max); $obtener = mysql_qu...
asked by 28.09.2018 / 06:13
1
answer

case within select mysql

Following the migration of SYBASE to MySQL I have found the following case, a case within the select. I leave the example in case you could guide me how to do it. Thank you!! select mvfg_cantidad * case mvfg_tipo_origen when 'P' then 1 else -1...
asked by 28.09.2018 / 12:17