Questions tagged as 'mysql'

1
answer

Group data from different tables and join in a modal those that are from the same group

Good afternoon! I'm having a problem with how to think of something effective. I have two tables: budgets and budgetlines. In the table budget_lines are some items, eg: Soap Inks Bags All of these records have the boolean id associ...
asked by 31.03.2017 / 18:07
2
answers

Same page, different content?

All links have the same url but the data is different. I'm working on a web based project where I have: game categories: games (table with games in each category) description of each game (more details) One of the categories is cal...
asked by 27.06.2017 / 21:09
4
answers

Search between dates

I need to search my MySQL for some registered employees. I have the dt_nation field and I need, for example, to look for employees who are between 20 and 30 years old, how can I do that? With this code snippet I get the dates, but unfortunate...
asked by 21.05.2014 / 19:49
2
answers

Merge results and cross with another table

I have two tables in MySQL: table_agendamentos: id - tratamentos 1 - 1 2 - 1,2,3 3 - 2,3 table_tratamentos: id - nome 1 - Facial 2 - Corporal 3 - Outros I want to make a query where I can return the following result: id - tr...
asked by 13.10.2014 / 20:14
6
answers

How to get distance given the coordinates using SQL?

I'm making a function in php , in which, given a GPS coordinate, it will search the database for registered locations, which are not necessarily fixed, within a certain distance. My question is: how do I calculate the distance between the co...
asked by 13.03.2014 / 13:19
2
answers

Update running multiple times in a single instance

I have had a problem with my system that some pages that do UPDATE in the inventory tables sometimes run multiple times, so the page was not loaded twice because I created a protection account. A single mysql_query instance is somehow running mu...
asked by 13.07.2015 / 19:18
1
answer

MySQL error 2002 connection refused

I hosted a site on 007gb.com and I am trying to access my remote database but I get the message "Mensagem do erro: SQLSTATE[HY000] [2002] Connection refused Code: 2002 Fatal error: Call to a member function prepare() on string in /srv/disk13...
asked by 06.02.2017 / 01:21
1
answer

PHP connection problems with MySQL (Access denied for user) [closed]

I'm a beginner in the area that refers to programming and computers. I'm having a problem that I can not get the solution anywhere. I have a Linux virtual machine with a MySQL server to supply the Zabbix Server monitoring tool (which is alrea...
asked by 20.01.2016 / 17:25
2
answers

Replace CRON

I made a script PHP which has to always run, usually 1 to 1 seconds or at most 2 to 2 seconds. The problem is that I set up multiple command lines on CRON to run every 1 second, but CRON automatically changes the configuration because I t...
asked by 05.04.2016 / 19:46
2
answers

SQL Autodelete query

How could I do a self-checking query in SQL, ie I would like to query such a value and then delete it in only one query. EX: select * from usuarios where nome=lucas that is, to get the result of searching and deleting. I know I would the...
asked by 02.01.2016 / 16:56