Questions tagged as 'mysql'

2
answers

I need help with a sql statement

You see, I am carrying out a project little by little and I have found a doubt that requires knowledge of sql and the truth is that I know the basics ... I need an ajax request to make me a select that returns the fields of 2 tables, but one...
asked by 29.04.2018 / 14:34
2
answers

Error "Can not add foreign key constraint" when relating two varchar fields

I am learning about relational databases and I have a problem when relating two tables with an auxiliary with a relationship of many to many. I am trying to relate two tables that have a varchar field as the primary key generating an auxiliar...
asked by 16.11.2017 / 09:41
1
answer

Count records in MySQL

I am working with MySQL and I need to make a query about the following table called tbl-reserva that has the following structure: id fecha_inicio fecha_fin descripcion The idea is to make a query t...
asked by 06.06.2017 / 04:35
2
answers

Display PDO query data in JSON format

I try to get the data from a query and print it on the screen but it does not show anything. $pdo=new PDO("mysql:dbname=usuario;host=localhost","root","root"); $statement=$pdo->prepare("SELECT * FROM usuario WHERE estado = 1 ORDER BY idusua...
asked by 02.03.2017 / 03:04
2
answers

concatenate with null values in mysql

I have the following: |ap_pat|ap_mat|pri_nombre|seg_nom| |Jara |Rios |Luis |ivan | |lopez |NULL |Jorge |alf | Concatenating with CONCAT or CONCAT_WS gives me a space of more between each data if this NULL...
asked by 02.03.2017 / 19:21
2
answers

How to verify if value exists using Jquery and if so, avoid sending the record?

I got some JQuery codes to verify if any value ( cedula in this case) exists in the database. The system works well, it shows when the card value exists or not, I would like now to prevent the form from being sent, because although it says t...
asked by 25.01.2017 / 23:55
2
answers

Message from mysql_fetch_array () expects parameter 1

I was trying to load content into an HTML table with the data I have in the database, but I find this "small" error. I have been visualizing different sites and as I did not find a quick and functional solution I come to you. This is my PHP c...
asked by 25.07.2016 / 07:09
3
answers

phpMyAdmin does not work on Ubuntu 16.04.1

Install Ubuntu 16.04.1 on a computer and I'm trying to install a local server, and install Apache2, php, MySQL and Phpmyadmin. When you open the browser and enter the address localhost/phpmyadmin you can not find the page. Now l...
asked by 14.10.2016 / 07:04
2
answers

copy the value of a variable does not work in nodejs

My function is: var copia; objBD.query('select max(ID_U) AS max_id from usuario ', function(err, rows, fields) { copia=rows[0].max_id; console.log(rows[0].max_id); }); console.log(copia); variable copia shows the value u...
asked by 30.09.2016 / 14:05
1
answer

Error in syntax with inner join in java

Good people, I am trying to fill a combobox with a query with inner join in java that is causing me conflicts and I can not understand it, I get the following error: My query is constructed in the following way: public void c...
asked by 01.08.2017 / 02:10