Questions tagged as 'mysql'

1
answer

QUERY - Can anyone help me build this query?

I have these 3 tables below: "users", "friends" and "posts". I want to get all my friends who are in the friends table and display their posts, taking their name and their image (which are in the users table). Imagine a news feed, where I...
asked by 03.01.2017 / 13:11
1
answer

How to save in MySql all data inserted in a form-control

Well, how can I make a script to save all data just after insertion. In case the view would be this. Afterenteringandtypingenterthedatawouldalreadybesavedinthebd.Whatisthebestwaytodothis?Hereistheexcerptfrommyform:<!--Domainstart--><...
asked by 08.05.2018 / 03:06
1
answer

Filter a field according to the format of the text

Can I filter the following formatting in a particular mysql field: (21) 2222-2222. I ask the understanding of the colleagues if I was not clear in my doubt, because I had a problem in the register of which the mask: $("#telefone").mask("(99)...
asked by 19.05.2016 / 17:25
2
answers

Include a digit before the phone in the DB [duplicate]

I have a system where 18 thousand users have been registered, but I realized that cell phones and landlines are missing a digit. Ex: (21) 9999-999 or (21) 2222-222. Although the field is CHAR (14). Can you directly include the number 9 (in the...
asked by 18.05.2016 / 20:58
4
answers

Prioritize word in SQL query - MsSQL

I have the following task: Make a query where I have to give preference to the last word as a parameter. I search in two fields with a OR , but I need to prioritize the query by the first field. For example: if I search for "% phy...
asked by 18.02.2014 / 14:16
3
answers

timestamp does not indicate the correct date

I'm working on a CMS for display of articles, my problem is with the function strtotime() does not indicate the correct date, always indicates March 1, 1970. A row (phpMyAdmin) of the article_timestamp is given with the format: e...
asked by 09.03.2014 / 11:31
1
answer

Error inserting into the Hibernate database

How do I insert the ProductIngredient object into the database that is composed of an Ingredient object that already exists in the database, without duplicating the Ingredient object in the database. If I remove the cascade and put in the Ingred...
asked by 08.03.2014 / 22:20
1
answer

Select with YEAR and MONTH together

Is it possible to combine the year and the month together, and to pass the 20017-06 to the select? SELECT SUM(valor) FROM contas where YEAR(data) = '2017' and MONTH(data) = '06'     
asked by 06.06.2017 / 00:21
1
answer

Trigger for update before insert

My database has two tables, the notification and the service, as the image shows. Inthenotificationtablethedefaultstatusvalueis"open." I tried to do a trigger that updates the default status "open" to "on-call" after a new call is entered...
asked by 16.06.2017 / 22:03
3
answers

How can I make a query with LIKE or REGEXP ignoring table words?

I have the following data in a table ------------------- **usuarios** ------------------- nome ------------------ Wallace de Souza Vizerra ------------------------ Gustavo Carmo da Costa I need to return the records of the usuarios t...
asked by 14.08.2015 / 18:45