Questions tagged as 'mysql'

2
answers

MYSQL get data grouped in SELECT with IF

I have the following SQL code SELECT e.sigla_equipo, e.patente_equipo, IF(j.nombre_jornada = 'NOCHE', CONCAT(c.nombre_conductor, ' ',c.apellidoPat_conductor), '') as noche, IF(j.nombre_jornada = 'DIA', CONCAT(c.nombre_conductor, ' ',c.apellido...
asked by 19.10.2018 / 16:54
1
answer

In mysql page how to get total records when the limit is applied?

Currently I'm doing two queries in my pages, in an extra, the list of data according to the page: SELECT * FROM tabla LIMIT 20,10 In another I apply the COUNT to obtain how many records in total that query has: SELECT COUNT(*) FROM...
asked by 28.11.2018 / 18:47
1
answer

How do I download image contained in PictureBox with database in C #?

I have a question that I can not solve and I am looking for your help ... I comment, I have a datagrid which has a column type image in which I use as a preview of my image that is loaded from a database. Often I have a button type column...
asked by 07.12.2018 / 23:00
1
answer

Relational data bases: problem when entering data

I'm trying to create a database where two tables have a relation to an intermediate table. The idea is simple; a table stores user records, their passwords, emails etc, while the other stores levels. (The levels belong to a kind of videogame...
asked by 02.04.2018 / 21:48
3
answers

Add total column and group by month in mysql

How do I add the total column and group by the column mes , but do not add me when the id_orden is repeated (218), and try to group them by month, and it looks like this: The sum of month 5 is 10 and the sum of month 1 gives 240, a...
asked by 17.05.2018 / 05:24
1
answer

MySQL Error Code 1215: Can not add foreign key constraint

I'm trying to create a database with this script in MySQL But I get error 1215 that can not add the FK constraint I've reviewed but I can not find the problem. Could you help me see the problem? CREATE DATABASE IF NOT EXISTS mybase; use mybas...
asked by 23.03.2018 / 01:18
1
answer

Error with SQL statement prepared using PHP

So far I have never used the prepared statements but from what I have read they are necessary when avoiding SQL injection as it could happen, for example, from a web form. To test them I wrote the following code: A function to connect to the...
asked by 20.05.2016 / 10:22
2
answers

How to change a price string in php

I'm having problems printing the price of my products so I want to change it, I mean I do my sql query SELECT * FROM sinventario,as_precios WHERE sinventario.FI_CODIGO = as_precios.FI_CODIGO I save my data in an array and print it whil...
asked by 31.05.2016 / 20:37
2
answers

Modify sql exit with python

When doing a query of a certain line of a database (MySQl) with python, the output it offers is of the type: Db_Host = '****' Db_Urs = '****' Db_Pass = '****' Db_Name = '****' def run_query(query=''): datos = [Db_Host, Db_Urs, Db...
asked by 18.06.2016 / 10:04
1
answer

convert query result Mysql to INT

If I have the following function: function obtener_id(){ $conn = db_connect(); $query = "SELECT max(idproblema) FROM problemas"; $result = @$conn->query($query); return $result; } What I want to do is that...
asked by 21.02.2018 / 22:48