Questions tagged as 'mysql'

1
answer

Foreign key with more than 1 value

I'm working on building my CBT and I've had a problem. I have a schedule table, and this table needs to store some data, among them, the activities that will be passed during the year. Due to this, I created the activities table, but there arise...
asked by 19.11.2017 / 23:58
1
answer

Paste local time with JS, save to MySQL, show with PHP

I'm getting the local time with JavaScript in the view, and sending it to the database. The database is storing this date and time as text. The date and time thus arrives in the database, eg: Sun Nov 19 2017 07:19:39 GMT-0300 (Standard tim...
asked by 19.11.2017 / 11:35
2
answers

How to find the data of the respective month

I'd like to know how to get only the data for the month we're in. For example: I have the date 2017-05-10 and I have the date 2017-11-05 , as I do to get the data only from a date with MySQL. I only want the date data 2017-11-...
asked by 17.11.2017 / 12:55
1
answer

SELECT with LIKE and LEFT JOIN

Hello, I'm trying to fetch records based on the name of the stone and the tags. Tables: ** Tabela tag ** ---------------- id nome ---------------- 1 Sem categoria 2 cs 3 weapon 4 balrog ** Tabela tag_rela...
asked by 17.11.2017 / 15:49
1
answer

MySql - How to make a Stored procedure be activated once a day?

I need a Stored Procedure to be called every day at 23:59:00 but I have already tried it in some ways and when it arrives at that time it does not execute! CREATE EVENT 'ATUALIZARDADOS' ON SCHEDULE EVERY 1 DAY STARTS '2017-11-16 23:59:...
asked by 17.11.2017 / 13:50
0
answers

Insert data into one table from other 4

I have this code to insert data into the database, I would like to insert data from 4 tables into one. But consecutively, I tried that way only because it adds the same data to the last 3 tables and only changes the data from the first select. W...
asked by 16.11.2017 / 20:13
1
answer

Update through another table - Mysql

I have the following problem: I have a rev_tasks table that contains id as a key, and a second rev_reviews table and has a foreign key task_id , pointing to the task, and I have a ( revised ) field review has been revised or not. In rev_...
asked by 16.11.2017 / 13:15
0
answers

programming in Ruby on Rails

I have a form and I include a médicos table, and in this table there is a enum field where you can choose the cooperativa option, but I have to check in another cooperativa table if this doctor has a cooperativa...
asked by 14.11.2017 / 15:50
2
answers

Last records based on a filter

Next, I need to bring in a query the last records that have not changed in the last 3 days from a specific ID , eg (id_chamado_status = '1') .     
asked by 14.11.2017 / 17:40
1
answer

Why this "Call to undefined method Database :: Prepare ()" error in PHP 5.2?

I am using the following class to connect to the MySQL database class Database { private static $link = null; private static function getLink() { if (self::$link) { return self::$link; } $ini...
asked by 17.11.2017 / 20:21