Questions tagged as 'mysql'

1
answer

Syntax error: Problem with variable inside the IF

My code: DELIMITER // CREATE FUNCTION f_desc (in_preco int) RETURNS INT BEGIN DECLARE fim_preco INT; IF in_preco >= 100 THEN -- aqui fim_preco := format(10 * in_preco/100, 2); ELSEIF in_preco >...
asked by 31.07.2018 / 23:07
2
answers

SQL how do I insert into a table that has FK?

How do I insert into in a table where there is an FK? example this is my structure Pessoa ID (primary key) nome varchar(20) id_endereco int not null (foreign key) _______________________________________ endereco ID (primary key) rua...
asked by 10.10.2018 / 10:18
1
answer

django does not connect to mysql database

I was doing this project in linux Mint and had to switch to windows and I'm having some problems setting up the environment. when running the command    $ python manage.py migrate I get the following error:    (venv) C:\Users\Nee...
asked by 10.10.2018 / 03:24
1
answer

Select where month name appears

Good afternoon, Currently I am developing an app where I list the month and sum of the consumption of each month in KW as shown in the print below: I just do not know how I would do to instead of listing the number of the month it appears...
asked by 30.07.2018 / 20:23
3
answers

How to use checkbox group to do search with php and mysql

I'm developing a real estate site with a search, where one of the filters is the neighborhood. Currently it's a dropbox, but I'd like to switch to a checkbox group so I can select more than 1 neighborhood at a time, how can I do that? I thoug...
asked by 23.07.2018 / 16:14
1
answer

How to create a Trigger in MySQL with more than one cursor

I'm trying to update two tables using the same trigger, however it only updates the sales table, but no errors occur. Here is the code: DELIMITER $$ CREATE TRIGGER depoisInsertNotas AFTER INSERT ON notas FOR EACH ROW BEGIN DECLARE done B...
asked by 24.07.2018 / 21:43
2
answers

Problem with accented words coming from the MySql database

I am using this query to show data coming from a moodle database, but words that have accents are shown with a question mark, I already used two charset types utf-8 and ISO-8859-1 but the error continues, follow image and code:...
asked by 24.07.2018 / 21:47
1
answer

Perform two COUNT with INNER JOIN

By using the SQL below to count the number of brokers in a table using INNER JOIN , it works perfectly. SQL: SELECT conta.acesso, count(corretor.cod) as num_corr FROM conta INNER JOIN corretor ON conta.i...
asked by 13.07.2018 / 16:38
2
answers

I need a php variable to be placed in a href link

The variable $fa has to be placed inside the link, but I can not do that This variable takes a data from the bank, is inside the php code $fa=$aux["celular"]; <a href = "https://///////////phone=$fa&text="> CLIQUE</a>...
asked by 13.07.2018 / 16:46
1
answer

How to increase the size of varchar in MySQL?

I have a table and access via MySQL, I am using this command to increase the varchar from 50 to 60: alter table tabela alter column nome varchar(60) not null But I only get the answer:    You have an error in your SQL syntax W...
asked by 13.07.2018 / 21:14