Questions tagged as 'mysql'

1
answer

Problems with MYSQL data return via include in PHP [closed]

I'm starting a code for a warehouse control using PHP and MYSQL, and by making a function document separate from index.php and performing the appropriate variable insertions via include declared in the head of index.php and call the variab...
asked by 20.09.2018 / 19:06
1
answer

Update Query with select for Procedure

I'm trying to do a query that will enter a procedure but I'm not having success, the query looks like this: UPDATE sca_lotacao AS t0 SET t0.ativo = 0 WHERE ( SELECT * FROM sca_pessoa AS t1 RIGHT JOIN sca_lotacao A...
asked by 08.12.2014 / 19:03
1
answer

Record in the database the office hours and make an appointment

Hello, I'm looking for a North to create with PHP and MySQL a way to record in the database the hours of operation of several establishments, so that I can easily search and display if the establishment is open, or closed, or until what time ther...
asked by 18.12.2014 / 14:43
0
answers

Problem fetching the most recent result of a group in a query in two tables with PHP and MySQLi

I am studying mysqli and PHP to migrate a personal blog, from PHP 5.6 to 7 (mysql to mysqli), the blog has a table with names and another with items related to names, dates and times, write a similar example. Before, I made a query in table 1...
asked by 15.09.2018 / 22:26
1
answer

How to Insert Insert MYSQL if it is Upload or URL

Hello, I would like to know how to do a mysql insert, but the way I did it, I just used the javascript just to change the imput URL to the File, that is, I am trying to work on the same imput name, however I have doubts what to do in the case if...
asked by 01.12.2018 / 12:44
1
answer

How to delete primary key (PK) in MySQL?

I have the following table in MySQL: The id column is the primary key. I would like to remove the primary key from this table. How can I do this? Thank you.     
asked by 30.11.2018 / 04:56
1
answer

Different conditions of the same column

I have a table named anuncios : id | nome | finalizar | datafim 1 | teste1 | N | 0000-00-00 2 | teste2 | S | 2018-12-05 I would like to make a SELECT listing only the records where the value of the finali...
asked by 02.12.2018 / 01:46
0
answers

Query in mysql grouping by days with count returning value 0 if there is no day

Good morning I'm doing a query in db like this: SELECT IFNULL(COUNT(*), 0) as numero, DAY(cdr.calldate) as dia, MONTH(cdr.calldate) as mes, YEAR(cdr.calldate) as ano FROM cdr LEFT JOIN peers on cdr.dst = peers.name WHERE cdr.calldate >= '20...
asked by 23.08.2018 / 15:02
1
answer

How to replace COUNT (*) in innoDB

I migrated data from a MyISAM database to InnoDB and some VIEW were extremely slow (on average 15x slower), after much research I found this answer from @maniero and it compares the two engines. In his response I noticed that InnoD...
asked by 23.08.2018 / 19:48
2
answers

UPDATE WITH SELECT AS CONDITION

I have an application that sends an email to the user to confirm their email when they register. Then I have two tables in my internal database, being USUÁRIOS and LOGIN . In the USUÁRIOS table I have the field confirme...
asked by 13.08.2018 / 20:25