Questions tagged as 'mysqli'

1
answer

Generate report between two dates with php and mysqli

I've been breaking my head for some time and need help. I have a code that retrieves a date from bd and compares the difference of days from that date to today. If this difference is less than 7 the weekly record gets a value and if it is les...
asked by 20.06.2018 / 17:14
1
answer

Update record in table using selected in MYSQL

I have this problem, which I can not solve. I have the following tables in the database: Andintheformitpullstherightdata,sointhenowthatI'llupdateforexampleonlythecardanddonotchangeanythingelseintheform,thefieldtypeofvehiclesandSectoritd...
asked by 10.05.2018 / 14:51
1
answer

How can I put an if in this mysql search when it returns no results?

How to put an if and else in this code for when the search in the database returns no value? include_once("conexao.php"); $sql= "SELECT FROM tb_nome WHERE nome LIKE '$pesquisar%'"; $salvar = mysqli_query($conexao,$sql); while ($linhas = mysqli...
asked by 11.06.2018 / 01:54
1
answer

Query on very large tables delay? Mysql

I'm developing a system that I expect to get big in the future and I'm having a dilemma: storing an array in each user's data or creating a specific table with all that mixed information (Ex: cars of each user) My question is: If I make...
asked by 03.04.2018 / 17:19
1
answer

SQL account how to do sum and subtraction

I'm starting to learn SQL need to make an account, I have a select for a report where I need to make an account to show another value in the fields of that report and formula can not appear on it. Query: SELECT application_name,...
asked by 23.03.2018 / 12:31
1
answer

How to use mysqli_fetch_all in PHP correctly?

I have a function in PHP using MySQL, it follows: public function listAll(){ $sql = mysqli_query($this->conectar, "SELECT * FROM items"); $this->desconectar; return $sql->fetch_all(); } My page for instance:...
asked by 14.11.2017 / 15:45
2
answers

Select and delete duplicate records by last update date?

Between the table fields there is the field name, the field dt_add which is the date the record was inserted and dt_update which is the date of the last update of the record. I would like to know how to return and delete repeated records, for...
asked by 07.11.2017 / 20:48
1
answer

Sending and Removing from Bank with Jquery

Hello! I recently made another post here, but it was poorly explained. I was wanting to make a form that does an insert in the bank and also removes. I have created a small system of titles, so users can favor those they liked best. It wor...
asked by 06.09.2017 / 22:51
2
answers

Update visits when opening the site

I'm making a function to change the count of visits on my site. The function is this: function visitas($conexao, $visita) { $query = "update visita set visitas= visitas + 1"; return mysqli_query($conexao, $query); } But I do not k...
asked by 20.09.2017 / 15:52
1
answer

Collate Last Ida Returned by Insert to Bank [duplicate]

In this Script below I make a loop where inside it I insert insert in the bank. at the end of each insert it returns the ID of the row recorded in the bank variable piece ($ sql-> insert_id.) so far everything OK if (isset($_POST['nome'])) {...
asked by 15.08.2017 / 05:29