Questions tagged as 'mysql'

1
answer

Insert two checkboxes into different fields in mysql

I have this code that creates this table with the first two fields already filled in by default: <?php $result_cursos = "SELECT nome, Quarto FROM centrodb.utentes WHERE descricaovalencia = 'LAR' AND nome <>...
asked by 31.03.2018 / 18:36
2
answers

MySQL query with infinite loop

My page 'list.php' gets in infinite loop when showing values. I used a while to show all database values The PHP code used on the listing.php <?php while($row = $resultado):?> <tr> <td><?php echo $row-...
asked by 01.04.2018 / 09:49
1
answer

Query to return the value that comes before a specific character

I have a table called answer that is filled with answers to certain questions, each answer usually starts with the letter that would be the answer, for example: a)..., b)..., c)... ou d)..., The problem is that it does not always s...
asked by 20.03.2018 / 13:23
1
answer

Error: "Column count does not match value count at row 1" when inserting value in table with trigger

After creating trigger : DELIMITER # CREATE TRIGGER BACKUP_PRODUTO_INS AFTER INSERT ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL, NEW.IDPRODUTO, NEW.NOME, NEW.VALOR, 'I'); END # DELIMITER ; DESC of the...
asked by 15.03.2018 / 04:13
1
answer

Querying database using ORDER BY kills my search

My code displays a list of people and a search field at the top. everything works fine, including searching. but I need people to appear randomly. The problem is that when I use the ORDER BY rand () (or any other ORDER BY) my search stops workin...
asked by 09.06.2018 / 06:11
1
answer

Conditional in MySQL

I would like to get a string obeying a condition in MySQL. For example I have a table with a column named descritor that is populated with PT or MT , I'd like to get the string Português to PT and Matemática to...
asked by 09.03.2018 / 12:01
1
answer

How to synchronize mysql database (security backup)

I have a website hosting files, (file server), I sync the files with another server .. in case something happens I have a copy of all the files .. But have some way to always save a copy of the database automatically? I always need to go to php...
asked by 20.05.2018 / 07:49
1
answer

Get name of the respective PHP table in SELECT UNION

Hello, guys, how are you? Does anyone know how to get the name of the respective table from the pulled value? I have the following code: $query= " SELECT DISTINCT titulo, categoria, views FROM ( SELECT DISTINCT titulo, categoria, views...
asked by 19.05.2018 / 06:28
1
answer

Query to return text from the middle of a field

I have a query that returns some class names / disciplines , however I wanted it to bring me just the names of the disciplines . Below is the result of the query with the [class] [discipline_name] [branch]: ADM N1A OFFICIAL COMMUNICATION...
asked by 09.02.2018 / 22:35
1
answer

Query date in mysql?

I need to look up and display the birthdays of the week on the system dashboard, but today a birthday boy is not showing up and would like to know where the error is. Anniversary column: 1970-02-15 (date is saved this way in bd), type date an...
asked by 15.02.2018 / 15:18