Questions tagged as 'mysql'

1
answer

Store stylized text for a news site [closed]

I am creating a news and articles website and this site will have a control panel where the adm will do the CRUD of the news and articles that they want to insert in the site. Well, I would like to know the best way to stylize this text and s...
asked by 10.04.2018 / 17:27
1
answer

Trigger MySQL - Error syntax

Can anyone tell me where I'm wrong in the Trigger below? CREATE TRIGGER atualiza_produto AFTER INSERT ON item_venda FOR EACH ROW BEGIN UPDATE produto SET vendido = 's' WHERE id = NEW.id_produto; END The error message: Você tem um err...
asked by 14.04.2018 / 03:10
0
answers

MySQL - Recursive query between two tables

Situation: Given the profile table (Figure 01), which describes the quantity, type and year of the questions (Figure 02) for the questionnaire (Figure 03), bring up the amount of questions, and the amount specified in the profile table is of for...
asked by 13.04.2018 / 22:05
2
answers

Delete duplicate records in MYSQL

I'm using a command that runs every second on node.js. It has the function of excluding any duplicate records for a given item, which is specified as in the example by AND t1.auction_id = 1335 . DELETE FROM bid_account t1 WHERE t1.id <...
asked by 14.04.2018 / 21:14
0
answers

How to send multiple image to DB?

Personal as you can see this is a piece of my cod I'm just sending the name of the property, forget the id_imovel because it is something else, I'm trying to send several images to the db, but when I send to the db it creates 2 times the msm...
asked by 10.04.2018 / 03:57
0
answers

Add / View Friend Database

I have a users table and a friends table, every friend is also a user, I would like to know how to insert items (add a friend) and how to check (list friends)? CREATE TABLE IF NOT EXISTS usuarios( id INT NOT NULL AUTO_INCR...
asked by 08.04.2018 / 15:02
0
answers

Do not save Array of value 0 in the database

guys, I have a form with 'n' quantities of inputs, all with the same structure: echo "<input name='quantidade[]' type='number'>"; When I finish the form and send it to the next page, it arrives to me in array, and I use this array to...
asked by 04.04.2018 / 21:56
0
answers

Lumen / Laravel - PDOException: could not find driver

I want to connect Lumen to MySQL. PHP INFO link Web.php file (containing the routes) $router->get('/', function () use ($router) { $results = app('db')->select("SELECT * FROM resenha"); return $router->app->ver...
asked by 04.04.2018 / 19:25
2
answers

Trigger with column check

I need to make a trigger in mysql, but I need it to run only when there is an update in the auctions that change the status to 3 or 4. It is of type AFTER UPDATE BEGIN IF (NEW.status IN ('3','4')) THEN QUERY_AQUI END IF; END     
asked by 05.04.2018 / 20:28
0
answers

Return a query taking data from three tables

I need the result of three tables in a query to generate a google charts chart. table 1: // This will be column One SELECT SUBSTRING(dt_vencimento,1,7) as anomes, SUM(vl_valor) as valor_total FROM escola.tb_despesas_administrativas where Y...
asked by 04.04.2018 / 03:35