Questions tagged as 'mysql'

2
answers

How to list specific data from a table with PDO?

How to list specific data of a table, but using PDO ? I'm starting to study and use PDO , but some things I can not find and that are well explained how to lite the data with a WHERE in the search. MySQLi is used this way, but...
asked by 04.02.2016 / 20:10
2
answers

'Sum if' in MySql workbench

I have a MySql database. No_Pedido|Valor|Cortesia 123|1000|Sim 123|500|Nao 124|200|Nao 124|500|Nao I need to make a select that returns the sum of the value per request that is not polite, would be sumif .. Select needs to loo...
asked by 08.11.2016 / 20:04
1
answer

Format date in INSERT and UPDATE Mysql PHP

Well, I have a data grid with a date, but I have to use a JQuery mask : $(document).ready(function(){ $('.date').mask('00.00.0000'); }); But when I make an INSERT, for example, the date 19.11.2016 becomes 21.11.2019. This same case h...
asked by 19.11.2016 / 21:17
1
answer

Concatenate result of select

I'm having a hard time showing the result of select the way I want. I will explain first what I have and then what I want, I have two tables in the database:    product_type: product_type_type, product_type and product_mark:   product...
asked by 09.02.2016 / 20:27
1
answer

How to make multiple checkbox records in the database at once?

How do I make multiple records with checkbox ? I need to make multiple records according to my tag in every% of% and include in the column checkbox the same id_item that comes from the variable ID in all records....
asked by 12.02.2016 / 04:08
2
answers

How to work with authorization levels with PHP? [closed]

I am putting together a school report system to train my skills in php. And I'm having a hard time. It is the following: I have 3 types of users: teacher, admin and student. The teacher can put note and change the note, but this note is only...
asked by 02.01.2017 / 16:01
1
answer

Error creating foreign key in MariaDB

When trying to create the toy table, the following error appears:    ERROR 1005 (HY000): Can not create table brinquedos . brinquedo   (errno: 150 "Foreign key constraint is incorrectly formed") Follow the code: CREATE TABL...
asked by 30.12.2016 / 16:33
1
answer

How to change primary key that references foreign key for auto increment

I have two tables, one call aluno and another call HistoricoAluno . After creating them, a change was made that was to leave the primary key of the alunos table as auto_increment . When trying to make this change I alwa...
asked by 20.11.2015 / 20:30
2
answers

Field that only allows an exact amount of data

How to put a field in mysql that only allows 4 characters. No more and no less? I'm doing this:    alter table cards add os_4_ultimos_digitos int (4); But a constraint is required and I can not do it.     
asked by 19.11.2015 / 13:51
1
answer

How to transform the row of a query into columns and group according to the first 4 characters?

I would like to transform the return of my SQL query into an array where I select the first four characters, which will work as a sort of group, and return the values referring to that group in columns. I'm analyzing the PHP language. HowI'd...
asked by 31.10.2017 / 18:10