Questions tagged as 'mysqli'

1
answer

Error inserting data into PHP database PDO [duplicate]

I'm trying to create a new database in the database with the following code and returns the error: Insert value list does not match column list or the registry is created but blank, the fields are NOT NULL, I already tried other options here i...
asked by 13.12.2017 / 20:05
1
answer

Error in my query ifnull. because? [closed]

Query is not red and blue works! SELECT * FROM posts LEFT JOIN (SELECT COUNT(id_rela_post), ifnull(qt_vezes, 0), para FROM rela_post GROUP BY para) post_detalhe on posts.id_post = post_detalhe.para     
asked by 26.02.2018 / 20:06
1
answer

SQL Search Specifies

Ola wanted to do a search in the database with and that only bring the response if conditions are reached used code. $sql2 ="SELECT * FROM 'link' WHERE 1 LIKE ds_url_orig='https://www.frasesdobem.com.br/frases-incriveis' AND ds_email_link_mod...
asked by 20.03.2018 / 16:34
2
answers

Infinite listing with mysqli_fetch_array ()

My code returns the database query, but lists only the last item entered, and lists it infinitely. I wonder where I'm going wrong. <?php //Início da listagem $servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'portfolio';...
asked by 13.09.2017 / 21:53
3
answers

Avoid multiple PHP Notice: Undefined index: within a for loop

The variable $words concatenates the result of a query in a column of a table where the words are comma-separated. Only when running the script for each word inside the for is generated a PHP Notice: Undefined index: agua in .......
asked by 13.07.2017 / 20:22
1
answer

MySQLi error INSERT [duplicate]

I'm not sure how to identify the error. I've always built such structures, but now that error is appearing.    Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE),   expecting '-' or identifier (T_STRING) or variable (T_VAR...
asked by 23.07.2017 / 18:05
2
answers

The inclusion of data is not occurring in the bank, and the connection and the variable is arriving at the function

function record_tarefa ($ connection, $ task) {         if (mysqli_connect_error ($ connection)) { echo 'Sem conexão com banco de dados'; die(); } $sqlGravar = " INSERT INTO tarefas (nome, descricao, prioridade) VALUES ( '{$tarefa['nom...
asked by 03.04.2016 / 05:59
1
answer

Staff a problem that seems very silly about the connection in PHP

I'm starting basic API for personal use, but at first I already came across a little problem that my eyes did not realize the origin:   Warning: mysqli_connect () expects parameter 1 to be string, object given in Here's my connection: &...
asked by 11.12.2016 / 16:29
1
answer

Timeout for each post

I need a solution to delete a post or a database record in 3 days, in which case the post will be available for 3 days and then deleted. I think of using the following line: DELETE FROM posts WHERE data_postagem (aqui que complica, penso em +...
asked by 24.10.2018 / 00:09
1
answer

Warning: Division by zero with dates

How can I calculate a range of dates, for example: 08/24/2017 and 09/05/2017 and get the total amount of days? For example the result of this difference would have to give 106 days difference from one date to another code: $data = $row['...
asked by 09.05.2017 / 23:07