Questions tagged as 'mysqli'

2
answers

Write data in two tables from a PHP form

Connection to bd $host = "localhost"; $user = "root"; $pass = ""; $conexao = mysqli_connect($host, $user, $pass) or die (mysql_error()); mysqli_select_db($conexao, "teste2"); HTML <head> <title>Gravar</titl...
asked by 30.09.2015 / 15:42
1
answer

Error in "=" in mysqli_query [closed]

I have a problem with mysqli_query and I can not find the error. I have already tried to make some changes that I saw on the internet and it did not work. I also tried to change the line that has a file problem, but the error persisted. The er...
asked by 17.08.2017 / 17:03
1
answer

What are the advantages and disadvantages of using object-oriented mysqli? [duplicate]

I've always used mysqli in the way I thought it was most convenient and never noticed any differences. Then came the question: why use object-oriented mysql? What are its advantages and disadvantages? To make understanding easier, an exampl...
asked by 27.06.2017 / 02:58
1
answer

While returning duplicate data

Good morning guys, I have this query $query = "SELECT p.*, c.nomeCategoria AS categoria FROM produto AS p INNER JOIN produto_categoria AS c"; $dados = mysqli_query($con, $query) or die(mysqli_error()); and a while that returns the value in...
asked by 24.07.2016 / 17:21
1
answer

Create dynamic chart using mysql and Highcharts

Personal I'm trying to create a chart using Mysql and Highcharts on a local Xampp server. However, when running index.php only the source code of the page is displayed, not generating the graphic. Following is the database, table, connection...
asked by 14.08.2016 / 19:33
2
answers

How to adapt code for mysql_

Hello, I would like to know how I can adapt the code below to mysqli necessarily the sections below. Excerpt to be modified for mysqli $filmes_generos = array_map('mysql_real_escape_string', array_map('trim', explode("," , $subanime["gene...
asked by 16.07.2015 / 07:21
2
answers

Phone book with database

I have a phone book with the form already ready and now I need that when the user type in the field to search for a name or sector, this value must be compared with values of the database and a value corresponding to the search of it is returned...
asked by 18.11.2014 / 15:09
1
answer

calculating date in mysql update

Well I need to update my accounts that are over 5 months old, I wanted to do this right in mysql. The update looks like this: UPDATE contas SET baixa_valivade = true WHERE data_vencimento (Preciso verificar se já esta vencida a mais de 5 meses...
asked by 26.09.2018 / 18:16
3
answers

Doubt with Mysqli and PHP OO

I have the following code snippet: public function registerUser($link, $nome, $sobrenome, $apelido) { $sql = "INSERT INTO estudo_oo (id, nome, sobrenome, apelido) VALUES ('', '$nome', '$sobrenome', '$apelido') "; if(!mysqli_query($link...
asked by 05.08.2014 / 00:51
2
answers

SQL helps to join 2 selects

I have 2 selects below, how can I join in just 1 select? I need to get everything sold in a certain period (BETWEEN) per item only at the same time I have to get what I had from the item's stock up to the start date. To separate whether it...
asked by 01.08.2018 / 23:01