Questions tagged as 'mysql'

4
answers

Error running SQL script in MySQL: Error Code: 1215. Can not add foreign key constraint

I am trying to execute this script, and it does not allow me to add the foreign keys, and I do not understand why. Can someone help me? CREATE TABLE IF NOT EXISTS 'clientes' ( 'numclie' int(11) NOT NULL, 'nombre' varchar(20) CHARACTER SET...
asked by 05.05.2016 / 09:25
1
answer

Order query (1,2,3,1,2,3.1 ...)

How about I have a table students with a column called " id_schools " in Mysql I want it is to make a "select" that throw me the results ordered as follows: nombre_a id_escuelas --------- ------------- Juan...
asked by 08.05.2018 / 18:03
1
answer

Problem with php and batch

I already set apache so that PHP can execute .bat files, I have to move files from another server to my computer to do operations with it, when I execute the batch manually if I do the function, but at run it from php...
asked by 03.04.2018 / 02:33
3
answers

Get a total through a single query

I have the following tables where I'm taking an inventory, but I also have a reservation table. Tabla Inventario ------------------- | pieza |cantidad | |--------|---------| | pieza1 |100 | | pieza2 |20 | | pieza3 |30 | |...
asked by 02.10.2018 / 21:30
1
answer

error when passing php variable with ajax

My problem is as follows I have a BOOSTRAP menu where the content is extracted from a database mysql , being that when selecting an option I load the content of a page in a field div of central id. When I make the selection I...
asked by 17.09.2018 / 22:52
5
answers

Block Form

I have a participant registration form, when I just registered the participants, another "detail" screen is displayed. But if you turn back again the form appears and you can re-register. How do I ban that? I do not want to block the button back...
asked by 04.10.2016 / 00:44
3
answers

Filter results in PHP / MySQL

I'm doing a message page in PHP and MySQL, I have a table called usuarios with the fields id , user , edad , pais and ciudad . I would like the user to be able to search for other users according to certa...
asked by 16.08.2017 / 16:05
3
answers

The query does not work, it does not detect letters

I'm trying to do a query in PHP and MYSQL, but it does not work for me, 'grado' is a number, for example 2. If I make the query only with 'grado' if it works, but if I try with 'grupo' which is a letter, for example B, it...
asked by 09.02.2016 / 15:58
1
answer

Are quotes important in mysql queries?

Specifically, I mean these - > '' when selecting the fields to consult. I understand that when entering values if it is important to tell if it is a number or a string, but to select the fields works whether you put them or...
asked by 08.01.2018 / 12:29
2
answers

Get email from a varchar field (in the BD) and then update

I have the following data recorded in my column: As you can see, it's a varchar and one I can record whatever I want, the idea is to create an application in php , that only take me inside the varchar the email , and then update t...
asked by 11.09.2018 / 20:03