Questions tagged as 'mysql'

1
answer

ERROR: Incorrect function

I developed a portal and it works correctly on localhost, but when I went to put it in the air, the connection to the bank stopped working. So when trying to connect to the bank he does not log into the portal, he just opens a blank page written...
asked by 15.02.2017 / 21:59
3
answers

Accent error in mysql [duplicate]

I'm having trouble highlighting my site's database. For example, in the database the text is " electric " but is posted on the site as " electric " I've tried a few things, but now in place of the " accents " you get "? " I have tried...
asked by 24.04.2018 / 14:12
3
answers

How to select users with the STATUS = 1 field in the user table? [closed]

I have a table called USERS with the fields NAME, STATUS. Suppose I have 10 registered users. How can I check if the 10 users have STATUS = 1 and if so, displays on the screen one (OK). I know you have to do a SELECT, so far, but what is t...
asked by 22.09.2016 / 03:15
4
answers

Encrypt / Decrypt MYSQL / PHP autoincrement ID

I need to encrypt / decrypt the original MySQL ID printed on the HTML, then revert to the original ID on the backend. Ex: $var = $arr['id']; // 120 <table> <tr> <td>Logradouro tal e tal, 123</td> <td>...
asked by 31.01.2018 / 00:31
1
answer

I can not execute DELETE in SQL when submitting form via POST in PHP

I have this code and would like to delete a list of users when the form was submitted, but it is not working: Any tips? if (!empty($_POST['username']) && !empty($_POST['email'])) { $query = mysql_query('INSERT INTO users (name...
asked by 16.04.2014 / 18:02
2
answers

Separate time and search between dates dd / mm / yyyy

I have a contracts table called contract with two columns data_ini and data_fim . data_ini and data_fim looks like this: 04/20/2014 10:46 AM I need to search between dates, without the time. If I did not have t...
asked by 20.04.2014 / 15:48
1
answer

Delete in an UPDATE trigger

How can I delete a record being inserted into a specific condition in a trigger? example: USE 'scompraslenovo'; DELIMITER $$ CREATE TRIGGER 'precad_fornecedor_BUPD' BEFORE UPDATE ON 'precad_fornecedor' FOR EACH ROW BEGIN IF (new.f1 IS N...
asked by 17.12.2014 / 16:54
2
answers

Is it possible to execute 2 queries at the same time in MySQL?

I need to create a stored procedure to update the salary of employees who earn less than 1000 and give a 10% increase. Other employees (who earn over 1000) will have a 15% reduction. I've done the following: DELIMITER $ CREATE PROCEDURE mod...
asked by 03.12.2018 / 02:09
1
answer

Can I use two insert into the same command

I have the following line of code and wanted to know if it is possible to do two select within a single sql command cmd = new MySqlCommand("insert into FUNCIONARIO('CPF_FUNCIONARIO', 'NOME_FUNCIONARIO', 'RG_FUNCIONARIO ', 'ENDEREÇO_FUNCIONARIO...
asked by 25.10.2018 / 05:09
3
answers

How to make a query that only refers to the DAY of a date?

I have a MYSQL database and I need a SQL that looks at the DAY OF PAYMENT in the DIA field (this field will only have the DAY of the month that the client chose to make the payment, this field is of type INT) and show me some less than 5 days be...
asked by 29.03.2016 / 21:26