Questions tagged as 'mysql'

1
answer

Delete query Java & Mysql

I am trying to remove a record from the database with the book code I pick up from a combo and from all its associated data tables using PrepareStatement but it is throwing me an error. I pass the code to you because surely it is not doin...
asked by 26.11.2016 / 01:33
2
answers

Syntax error or access violation: 1059 Identifier name '' is too long lumen

I'm migrating to the database with a lumen, and I get the error that the primary key is too long. What I want is to put the three columns as composite keys. public function up() { if(!Schema::hasTable('asignaturas_alumno')){ Sch...
asked by 29.03.2017 / 15:13
4
answers

Join two SQL queries [duplicated]

I have two tables and two queries for each table A query is SELECT DISTINCT CodContrato, FechaBaja, FechaFin FROM Contrato WHERE (FechaBaja != FechaFin) AND (FechaBaja BETWEEN '20180101 00:00:00' AND '20181231 23:59:59') and the other...
asked by 12.12.2018 / 10:16
2
answers

Error verifying if a record exists in the database

The following code gives me the error: Notice : Trying to get property of non-object in ... What it does is verify if a user exists in the database. $cate = $_POST['cat']; $veri = "SELECT * FROM category WHERE name = '$cate' "; $result = $...
asked by 13.02.2017 / 02:23
1
answer

How can I load data into some html text fields when the first loses focus?

I have a small conflict with a project that I am working on. It turns out that I need to load the code of a material, and when it loses its focus, it is necessary to perform a search in the database, take the data from the Materials table...
asked by 10.10.2018 / 15:10
2
answers

Store several variables (or an array) in the same field (MySQL) [closed]

Can someone tell me what would be the best option to store the following data? The user (within a form) has the possibility to select multiple checkboxes (19), and I need to store if they are marked or not (all of them) in a single field....
asked by 09.10.2018 / 19:40
2
answers

Add query results with group by

I have the following query SELECT count(dp.id_dieta) * (select d.dieta from dietas d where d.idDietas = dp.id_dieta) as t FROM dietaspartes dp WHERE dp.id_parte in (SELECT p.idparte as part FROM partes p WHERE p.IDProyecto...
asked by 03.12.2018 / 15:14
3
answers

$ _GET id does not work for me

I have the following code in php $sql = "SELECT * FROM categorias WHERE categoria_id='{$_GET['id']}'"; $resultado = mysqli_query($con, $sql); if (mysqli_num_rows($resultado) > 0) { while ($row = mysqli_fetch_assoc($resultado)) { //......
asked by 09.08.2016 / 14:35
2
answers

You doubt about queries in MySql and pass data in laravel to a view

I have a question about the query tables in Mysql, I want to get different data about a survey and then add this data. I understand that I have to call my data on the 3 tables so SELECT Orders.OrderID, Customers.CustomerName, Shippers.Shipp...
asked by 30.08.2018 / 20:50
1
answer

error in java when saving image in mysql

in the following code, the insert dataData works perfectly, but the editData method is giving me a headache, I do not find it back public int insertDatos(String nom,String apell,String com,String pos,String emai,String tele,String not, F...
asked by 07.08.2018 / 22:27