Questions tagged as 'mysql'

3
answers

Duplicate record with new ID and another custom field

I have a database ( basedatos ) and a table ( contratos ) with the following fields: Id Nombre Fecha (timestamp) Vendedor Telefono Gestionado I want to insert in a php page a button that duplicates the record but with the conse...
asked by 09.06.2017 / 10:13
3
answers

how to start Primary key from a predetermined number?

Greetings, I'm in the installation of my degree project, it's a web system it should be installed in the cloud, but as the institution for which the project is carried out does not have an internet service and has several offices scattered throu...
asked by 14.09.2017 / 13:54
3
answers

Execute MYSQL in a bash script

Greetings community I hope you are well. I have a problem, I want to run a few MYSQL statements but as BASH , I need to run this on ubuntu. I have created a file called scripts.sh where I have placed the sentences to execute:...
asked by 17.12.2018 / 22:51
2
answers

SQL does not work, where [closed]

SELECT id, date_start, date_end as "ID" FROM project_task a inner join project_task_type b where a.date_start is not NULL and a.date_end is NULL Give error in where     
asked by 17.12.2018 / 10:17
1
answer

Problem with a SELECT

I have the following SELECT generated by a JSON array with objects that are hotels. SELECT CONCAT( '[', GROUP_CONCAT(JSON_OBJECT('id', h.hotel_id , 'nom', h.nom, 'estrelles', h.categoria, 'puntuacio', h.puntacio, 'tipus', h...
asked by 16.03.2018 / 11:03
2
answers

I update my user as root

I have a question, I have a form where I update the fields of the users the problem is when I want to update the username I update it as root regardless of what you type it always updates it as root. <form action="ejecutareditar.php" method...
asked by 08.06.2018 / 19:57
3
answers

Error modifying a table in MYSQL from Java

"UPDATE usuarios SET Telefono= "+tel+", Domicilio= "+dom+", Contraseña= "+contra+" WHERE Id="+id;    This is the sentence that I use when updating the database, the data of the columns and its name are correct but it sends me the following err...
asked by 27.10.2017 / 19:10
1
answer

How do I get my data from a SELECT MAX (user_id) FROM user

I have my next method where I want to get the last record of my user table, but it is bringing me 0 when I should bring 4. Where is it failing?    Method public static int getIdOfEmployee(){ Connection con = null; int id_usuario =...
asked by 13.12.2017 / 20:10
4
answers

how to save the result of a subquery in mysql in order to compare it

I have a query from the users table. Among its fields I have a field called "fechadenacimiento", through a subquery I get the age and I show it in the results. Note that this value does not exist in the table I get it on the fly, however I need...
asked by 23.11.2018 / 11:20
1
answer

The PreparedStatement gets stuck when I ask a lot of questions

I have a method that has to be constantly sending requests to the server where the database is hosted, the place where I try to connect to the internet via satellite dish. The function of the program is to send a number also keeping date and...
asked by 16.06.2017 / 13:21