Questions tagged as 'mysql'

3
answers

How to Block a button

I have a system where you have registered items and the logged in user tries to hit the results of those matches. Each game has a id of register that is named (game) in the database. My question is: how do I get the user to only bet on...
asked by 09.11.2017 / 13:17
1
answer

Select with when and case

I have the following select query: select F.nu_ine INE, to_char(D.dt_ficha, 'YYYYMM') as CMP, I.co_cbo_2002 CBO, CASE WHEN (B.tp_atend = 1 or B.tp_atend = 2 or B.tp_atend = 5) and I.co_cbo_2002 != '225142' THEN '0301010030' WHEN (B.tp_atend =...
asked by 09.11.2017 / 19:04
1
answer

Save only day and month in DATE field in mysql with php?

I need to register commemorative dates in the database, but I only need the day and month, the year is not relevant and does not need to be registered. My question is, can I save only the day and month in the Date do MYSQL field? or bette...
asked by 07.07.2017 / 16:27
2
answers

Doubt with SELECT in MYSQL database

I need an sql that, in the table below, always brings the last insert for each user. I tried with distinct but it did not work. So in the case below sql would bring the results of line 2 and 5. Detail that there are more columns (city, country,...
asked by 17.07.2017 / 23:00
1
answer

Duplicate record in database with new id

I have a table in the database called user, with n fields, how can I duplicate a certain record only with a new id? insert into usuarios * select * from usuarios where id = x? obs: this id is a non-null primary key     
asked by 18.07.2017 / 03:02
2
answers

MySql does not save all characters [closed]

I've implemented CKeditor in my textarea, but it is not saving the data correctly in the DB. The result looks like this: If I write Test in bold, the result of the pure html would be: <p><strong>teste</strong></p>...
asked by 19.09.2017 / 01:46
1
answer

Form does not import database "values"

In my system there is a registration page and a page with a table of the information of the registered ones. This table has an edit button that links to an equal form on the registration page. What should happen: The fields on this edit...
asked by 01.09.2017 / 18:40
2
answers

GetSQLValueString / mysqli_real_escape_string / Notice: Undefined variable: mysqli

I'm trying to convert a function to Mysqli, for use with PHP7.1. I'm having difficulty with mysqli_real_escape_string , and mysqli_escape_string . Error:    Notice: Undefined variable: mysqli in   config.php on line 16       W...
asked by 15.06.2017 / 19:00
3
answers

Query error by date

In my application I have a query by date, below is a snippet of the script tblacesso.HorarioSaida BETWEEN '2017-06-17 00:00:00' AND '2017-06-17 23:59:59' But he is not selecting the data of the day in question, below is an image in the data...
asked by 19.06.2017 / 14:55
1
answer

Random order with MySql pagination

Hello, I am having to randomly sort result from my query and display paging using mysql. The sort and pagination are working perfectly. Whenever pagination is done, because of the use of ORDER BY RAND(); , the results are random and rep...
asked by 28.06.2017 / 20:23