Questions tagged as 'mysql'

2
answers

Indexing views in MySQL

I have a view in my MySQL database, I would like to know if it is possible to index the fields that are contained in it, since I have a group by in it that is consuming a lot, and an index would solve this problem or at least help....
asked by 12.07.2016 / 15:49
1
answer

Mysql event to delete expired rows

I'm trying to create an event to delete rows, that the column date is with the date expired, that is smaller than the current one. I was trying with the following command: create event e on schedule every 1 day do delete from Reserve...
asked by 11.04.2016 / 01:51
3
answers

Select from two tables without repeating data

I have two tables, one of users and one of photos where each line contains the user id of the respective photo. I want to select the user data and get the photos by the user id of the photos table. In this way it returns me the duplicate d...
asked by 04.01.2016 / 19:02
1
answer

Variable error

I have tried to find a mistake that is happening to me and I could not, I think it may be silly.  Error:    Notice: Undefined variable: st in   /var/www/html/questions/chk-gerent.php on line 143 The line he is pointing at is this: $quer...
asked by 08.02.2016 / 10:58
2
answers

last mysql record

How to know the last record of the ID in the table and play the number in a textblock? using (_connection = new MySqlConnection("Database=test;Data Source=localhost;User Id=root;Password=teste;SslMode=None;")) { System.Tex...
asked by 10.03.2017 / 10:39
0
answers

Blocking (backup) of an auto increment line in mysql

I developed a CSV data importer for my mysql base. The feature is working properly, however I believe you should have a better way to implement the following logic. In the CSV file depending on whether or not 2 inserts (master-deta...
asked by 17.06.2015 / 14:49
1
answer

Do not insert equal data into the database

I'm getting data from an XML, converting it to array and inserting it into the database. But I only need results that do not exist yet. Below is my code, I have tried in many other ways, none with a good result. In the code below alway...
asked by 07.03.2014 / 21:55
2
answers

Button can only be clicked after 24 hours after the click

Hello everyone, I have a website and I want the following (I can not do it, nor found it on the net), a button that after the click is registered in db, after that the button can only be clicked after 24 hours, check-in is like this: -- Check-...
asked by 19.07.2018 / 01:26
3
answers

Select date with Between in Varchar format

I am redoing the question because I did not get the desired result, I would like to do a select in the date field but the between is not working, I believe it is due to my date field being in VARCHAR format, I tested the code below: ("SELECT *...
asked by 05.10.2017 / 18:58
1
answer

Uncaught Error: Call to undefined function

I'm having problem validating Select , it would be a login validation and I'm having a Select problem. Fatal error: Uncaught Error: Call to undefined function select * from usuario where email='() in C:\WEB\cadastro\valida.php:4 Stack...
asked by 18.09.2017 / 18:27