Questions tagged as 'mysql'

1
answer

Select - Time comparison does not work

I'm trying to make a query to eliminate results in which the end time of the event is equal to 00:00:00, I made the query this way: select nome, local, hora_inicio, hora_fim, data_inicio, data_fim from agenda where hora_fim <> 00:00:00;...
asked by 21.02.2017 / 19:48
1
answer

How to check for repeated emails in the database? [closed]

When I am going to put an email, whether it is repeated or not, it returns me this error here:    Warning: mysql_num_rows () expects parameter 1 to be resource, boolean   given in C: \ xampp \ htdocs \ systemslogin \ classes \ connect.php on...
asked by 07.03.2017 / 23:06
2
answers

How to generate automatic fields

I need to go to the database to fetch the img and go showing it in every <li> </li> of the carousel, however I had to leave it automatic, since it's a lot of photos, is there any way? <div id="wrapper"> <d...
asked by 01.02.2017 / 21:07
2
answers

How to retrieve 'mysqli-insert_id' from within this function, in addition to the query return?

public function executar($sql){ $con = new conexao(); $con->abrir(); $re = $con->mysqli->query($sql); // Preciso retornar esta informação tambem: $last_id = $con->mysqli->insert_id; $con->fechar();...
asked by 01.02.2017 / 12:15
6
answers

If it does not work

I'm developing a website, some users will access it, and I need the password to expire every 30 days . I did this check, but it never crashes, even when the if is true. If anyone has any idea what might be wrong or a tip to improve, thank you....
asked by 31.01.2017 / 21:51
1
answer

How to execute SQL with Entity Framework?

I tried to run a SQL command by Entity Framework , I tried the following ways: string cmd = "UPDATE t0071_compra SET t0071_status = 'Enviado' WHERE t0071_id_compra = 4 AND t0020_id_empresa = 1"; context.Database.SqlQuery<string...
asked by 24.01.2017 / 20:31
1
answer

How to perform query on more than one table (Wordpress)

How do I do a QUERY in the database in 5 different tables and return the values I want, eg: I am performing a search system (my first) and need to capture the following values: Name of Applicant, Title of Curriculum and Category of Vac...
asked by 08.02.2017 / 20:15
1
answer

Link images to category

I'm developing a slideshow based on categories. That is, categories are pulled from the database and images are attached to them. However, I'm having 2 problems. The first is the miniatures of the categories. One or more category thumbnails appe...
asked by 07.02.2017 / 13:15
1
answer

Select the previous 3 months

Hello, I have the following table: ---------------------- downloads | data ---------------------- 10 | 2016-12-01 15 | 2016-12-02 20 | 2017-01-01 30 | 2017-02-01 40 | 2017-03-01 That way I can add the numb...
asked by 03.03.2017 / 20:31
1
answer

Select with max (date), penultima (date)

I have a table with product code and date of sale. I would like to make a select picking the product code, the date of the last sale and the date of the next-to-last sale with group by code. Is it possible? select p.codigo, max(date_format(p...
asked by 13.01.2017 / 14:21