Questions tagged as 'mysql'

1
answer

How to make PHPMailer and send the values to a MySQL database

I'm trying to send form data to an email using PHPMailer (this is already working) and take advantage of it to include this data in a MySQL database table. It did not work, I guess the error is in the code. <?php // Adiciona o arquivo cl...
asked by 26.09.2017 / 00:42
2
answers

How to retrieve values from two tables in Mysql

It's the first time I ask a question here, and I'm having the following difficulty. I am doing my info CBT, it is a site for students and such ... is it like Facebook bags? I caught in the part where PHP retrieves the data from the 'post' tab...
asked by 25.09.2017 / 22:28
1
answer

Error 1005: MySQL - does not create foreign key

I have a problem with MariaDB. I have created two tables tbl_estoque and tbl_adiciona . Basically, I do not want to add data directly to tbl_estoque . I want it to be trigger to check if the last record of tbl_...
asked by 24.09.2017 / 16:36
0
answers

Generic Crud with phpoo and pdo (without framework)

I want to make a kind of Generic Crud and I implemented the insert function, I know that the way I did it is not the best way to do it and I do not want to use any kind of frameworks and so I would like help, tips. > What else is causing me co...
asked by 14.09.2017 / 03:42
0
answers

Reset AUTO_INCREMENT without losing data

I'm working with a table of trades where the number of the trade and the year it was created are a composite primary key. I am generating the trade number using AUTO_INCREMENT and taking the current year with php , however, I would like for e...
asked by 14.09.2017 / 18:55
1
answer

List the result of a query

I want to return in my code a list of users through a data query, I have the following model: <?php class Usuario{ public function listar($condicoes = array()){ $db = DB::criar('padrao'); $sql = "select * from func";...
asked by 14.09.2017 / 21:38
2
answers

Error "1241 - Operand should contain 1 column" trigger that checks for duplicates

I'm doing this trigger to check if dados_id and referente_obs exists in the bank table But it returns this error:    1241 - Operand should contain 1 column (s); BEGIN IF (NEW.id_dados and NEW.referente_obs) not in (...
asked by 14.09.2017 / 19:25
0
answers

Conversion to PDO

I would like your help to turn the following code into PHP PDO. I made the following conversions and commented the front of the code, just to heal the doubt itself. Will the conversion be correct? <?php function retorna($cod_material, $...
asked by 20.11.2017 / 21:16
2
answers

how to return mysql values directly to the inputs (select)?

Here on this page each input should appear with your response as saved in the database. <div class="div-label"> <label>Alguma alergia a medicamentos?</label> <select class="select-form" n...
asked by 21.11.2017 / 04:24
0
answers

How to update several php postgresql records?

I need to update multiple records at the same time with php / postgresql (also for mysql) through a checkbox and textbox but I can not. The code below only updates the last record's sequence field and does not update the status. The remaining re...
asked by 20.11.2017 / 22:12