Questions tagged as 'mysql'

3
answers

Do not fill field if it does not exist

I have a question about how to ask a question to the database. Suppose I have two tables with slightly different structures Table1 id tipoA data 0 A '21/12/14' Table2 id tipoB data 1 B...
asked by 16.06.2015 / 16:26
1
answer

MySQL Transactions written in the same table

When I see this answer I was left with this question: If we have 2 transactions to be handled at the same time, in the first one (A) we are writing to table x, in the second (B) if we try to write to table x at the same time, what happens?...
asked by 06.05.2014 / 15:12
2
answers

Checking days remaining between current date and deadline for contact [duplicate]

Good afternoon folks, as per the code below, I can not check the remaining days between $ date and $ prazocontato. $consulta = mysql_query(" SELECT s.id_cliente, p.nome_servicos, s.data, s.prazocontato, s.email, s.vaifazerservicos...
asked by 25.07.2016 / 20:39
1
answer

Doubt in MySQL table relationship Workbench

Hello, I have a small problem creating a database. My goal is to create a table to mark the attendance of people in the classes of the courses in which they are enrolled. The 'presecas' table should contain the id of the person, the course...
asked by 13.10.2015 / 02:51
1
answer

Use registered addresses in the database in JavaScript / Google Maps

I have in a database the following columns: client name, active or inactive, address and lat and lng coordinates. I need to develop an application in PHP that will display in the Google Maps green bookmarks the active clients, and red the ina...
asked by 19.11.2014 / 13:54
1
answer

How not to display past date records

I made a schedule and I need events that have already passed do not appear any more, the dates are with 3 DAY / MONTH / YEAR fields, I am using concat and date to join and format the dates, so the current query is as follows: $query = mysql_qu...
asked by 13.04.2014 / 07:38
1
answer

Query gets slow with ORDER BY

I have a problem, I have a query and when I use ORDER BY it gets very slow.    Note: I created an index for the premium field and another index for the score Follow the complete query: SELECT p.id AS id_freelancer, p.nom...
asked by 11.04.2014 / 22:35
1
answer

How to rename a constraint in mysql?

I created a primary key constraint in my table as follows: CONSTRAINT PK_user_type PRIMARY KEY(id) But now I need to rename it to: CONSTRAINT PK_type PRIMARY KEY(id) Based on this, I have the following questions: 1 - How...
asked by 10.10.2018 / 22:29
1
answer

Error in PDO query

I am creating a registration page where I have several tabs, according to the structure below: <div> Aba 1 </div> <div> Aba 2 </div> <div> Aba 3 </div> <div> Aba 4 </div> e assim vai... Inside...
asked by 04.02.2015 / 15:09
1
answer

How to select multiple columns using the table prefix only once?

In the relational model condition, I have to specify the table prefix, am I right? Example: SELECT c.nome, c.idade, a.nome, a.idade FROM ... What I wanted to know is if you can not do something like this: SELECT c(nome, idade)...
asked by 23.03.2017 / 20:59