Questions tagged as 'mysql'

1
answer

insert server_id in the creation of each record, mysql

I have a table in mysql whose records can be created from different servers, these servers are configured as master and slave, and the id of each server was set to 1 , 2 , 3 e etc. I would like to know if it is possible...
asked by 29.06.2018 / 12:43
1
answer

Reapprove the result of a function in Where

Hello, I'm working with MYSQL, I would like to know if I can use the result of a function in the where by calling the alias. Today I have to repeat the code, in case this GEO function SELECT *,round(geo(-46.000000,-23.000000,latitude,longitu...
asked by 15.01.2018 / 01:36
1
answer

PHP page does not identify SELECT result

I'm doing a PHP page to show database information, but it does not give an error and only returns " :0 " on the page, as if there had not been any results from SELECT (only enters else ). Follow the code: <?php $c...
asked by 18.01.2018 / 15:01
2
answers

Query between tables

I need to make a query as follows: select a jovem that is in the same cidade and estado as mentor and has the largest number of features equal to mentor . My query: SELECT * FROM jovem INNER JOIN ment...
asked by 17.01.2018 / 14:54
2
answers

get input value hidden inside a td tag

how to get value from this input inside the table with data from bd:    HTML CODE <table id="tbl_3" class="table table-striped table-bordered table-hover"> <thead> <tr> <th style='text-align: center;' >NOME...
asked by 21.02.2018 / 19:33
2
answers

MySQL Query with recursion in N levels

I have the following query select id, nome, user_id from (select * from users order by user_id, id) users, (select @pv := '2') initialisation where find_in_set(user_id, @pv) > 0 and @pv := conc...
asked by 02.03.2018 / 15:04
2
answers

How to monitor changes in the database without making abusive queries

I have a code that accesses the database every second and returns me the number of rows in a table, the problem is that an abusive number of requests and queries are made in the database to monitor changes in the rows, I need of something that m...
asked by 10.01.2018 / 01:38
1
answer

Simple script to know how many users are online on the site?

Friends, is there any simple script in php (or some other solution for linux php / mysql server) to know how many users are online on the site? I read that websocket is good for chats. In my case, it's not chat or anything complex is not. Just k...
asked by 07.01.2018 / 02:23
2
answers

Error with SQL and MariaDB (Current position is before the first row)

I have a problem with my database and I have no idea what it is. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res = connection.createStatement().executeQuery("select permission fr...
asked by 06.01.2018 / 08:25
1
answer

Problem when trying to query with PHP and MYSQL

I'm trying to do a query directly in the PHP file where it creates the connection to the database. This query will create my table. The problem is that I am trying to reference the connection variable in mysqli_query () and it is not being...
asked by 04.01.2018 / 19:52