Questions tagged as 'mysql'

2
answers

Erase all information in the table the last inserted id

How do I delete the table in the database all data, in php, by the last id inserted? For example in the table the last ID is 37, where it has the name, age, etc ..., I want to delete all of this ID, make that line disappear. My question is not...
asked by 24.05.2018 / 12:27
1
answer

MySQL event to block user with x complaints

I have a complaints table where I record the information of users who reported and who they reported id | user | denunciado 1 | userx | userY 2 | userz | userY And so on, now I would like to make a daily event in mysql...
asked by 14.04.2014 / 21:58
3
answers

How to show an array coming from the database in an input

<input type="text" class="form-control" name="lanches" id="lanches" value="<?php echo $resultado['lanches']; ?>" > I have this input above where it receives this array that is inside the database How do I ...     
asked by 02.12.2018 / 02:28
1
answer

Select that picks up the last 30 days from the current date

Good morning, this is a part of query that I used to fetch the last days from the current date. It works as expected when I put -20 , but putting -30 does not. WHERE viacao_os.creation_date BETWEEN CURRENT_DATE() -30 AND CURRENT_DATE()...
asked by 21.03.2018 / 15:35
1
answer

When entering a record in pag1, refresh pag2

Good morning. This is a conceptual question. I never needed it, so I do not know if it works. Imagine the following situation: I have a script A, where I enter information into the database. This script is running 100%. I have a B script,...
asked by 17.03.2018 / 16:18
1
answer

LEFT JOIN tanned

I have the following tables in MySQL (it is more complex than the example, I simplified it): CURSO: id | nome CURTIDA: id | id_curso Every time someone takes a course, they feed the CURTIDA table Now, when I'm going to SELECT the cours...
asked by 19.02.2018 / 18:16
2
answers

How to normalize this small database?

I'm trying to improve this small database of the TCC's technician, he's very small, it's from a small page to a trade, in which I would have a catalog of products and deals to attract buyers to the physical store. I hope you can give me some tip...
asked by 26.02.2018 / 02:10
2
answers

Non-filtering search filter

So, I have a page with a search form pro user selecting what will appear in his table. When the user clicks the submit button, another page should appear with the table properly filtered. This is the code for the page that will open: <!-...
asked by 26.10.2017 / 17:47
2
answers

submit a form when selecting a select option, without doing page reload

I need to submit the data of a form (they are hidden) when selecting the option in select, this with ajax without reload of the page. I have the following code, which works fine, but does not send (POST) form data that is hidden: <form c...
asked by 08.11.2017 / 13:23
1
answer

SQL Procedure (executed every second)

Can anyone explain to me how this mysql command will work? SELECT @row := @row + 1 AS n_linha , m.* FROM (SELECT b.user_id as prox_user_id, t.auctionID, t.productID, t.auc_due_price+t.auc_plus_price AS prox_valor, t.auc_due_time, b.id as...
asked by 21.10.2017 / 14:48