Questions tagged as 'mysql'

1
answer

SQL query to fix badly coded accents

For an error, I have entered records in a table with the accents of the type о, о. Normally we save the records with the correct accents. So I would like to know if there are any questions that you can apply to the table to replace those or...
asked by 14.09.2018 / 12:31
1
answer

Show different rows in the same query

Hi guys I have a problem with a mysql query, maybe it's super simple but I need a push to get it out. It is a table of student registrations in which each student has different status such as "Registered", "Canceled", "Pending", "In Process"....
asked by 19.09.2018 / 19:44
1
answer

I can not add a record to my database, mark error PreparedStatement [duplicated]

I am trying to add data to a database using a button, but at the moment of entering the data I get an error in the Prepared Statement part and my SQL statement I tried it on my local server (phpmyadmin) and it worked perfection, and I have not...
asked by 22.10.2017 / 08:40
2
answers

Check MySQL duplicate records (only the first two)

Good morning, I'm new to subqueries, I have a table that registers ip addresses of computers connected to the day, my idea is to list only the first two or a computer corresponding to an ip address I explain (table equipment) my curr...
asked by 23.10.2017 / 06:37
1
answer

add in bd a date 2 days after today without counting saturday and sunday in mysql php

I have an insert in mysql database of dates, I am using the date_sub command to add 4 days to the current date, $fecha_actual = now(); INSERT INTO TABLA_FECHAS (preparar, llamar) VALUES (' . $fecha_actual .',date_sub(' . $fecha_act...
asked by 08.02.2018 / 20:05
2
answers

Connect java with mysql

I have a simple java application, which has 2 options, show the amount of paint cans in the inventory, and show the sum of the prices of all the paint cans, and I have all that data in a simple base of data in MySQL, my question is how can I con...
asked by 15.02.2018 / 02:33
2
answers

In a query Is it possible to fill a field with all the records of another table?

I am making a query and in a field of that query I want to concatenate or extract all the data that is in another table. Is it possible to do this? This is the query I'm doing: SELECT r.id_resg as 'CLAVE RESGUARDO', -- AQUI QUISIERA...
asked by 05.11.2016 / 22:18
1
answer

Consult select with eloquent in Laravel

I'm starting with Laravel and I have two simple entities that are users and notas , which are related in the following way: Users public function notes() { return $this->hasMany('App\Note'); } Notes public functio...
asked by 16.01.2018 / 14:51
1
answer

MYSQL - problem with ORDER BY of a column of equal values

I have the following MYSQL query: SELECT *, ( SELECT SUM(points) FROM point WHERE employeeId=employee.id ) as totalPoints FROM employee ORDER BY totalPoints DESC As you can see is a simple l...
asked by 15.06.2018 / 21:51
4
answers

Validate existing user

When I prepare this query, I want it to validate if the user exists or not, and for that I use "mysqli_num_rows ()". The problem is that if I do it without preparing the query, putting the query to hair (it is commented in the code), it works. B...
asked by 30.11.2016 / 22:15