Questions tagged as 'mysqli'

1
answer

Query string works in Phpmyadmin and does not work in PHP

I have the following query that takes a date, has been tested in phpmyadmin and in the HeidiSQL program successfully: Query Mysql set @rn:=0,@grp:=0,@prevdate:=''; from (select DataEncomenda, @rn:=@rn+1 as rownum, @grp:=if(@prevdat...
asked by 01.12.2016 / 15:01
1
answer

mysqli_query () expects parameter 1 to be mysqli, null given in, how to solve?

I want to insert the values of the form into the database, but it presents the error.    mysqli_query () expects parameter 1 to be mysqli, null given in Linking php code: <?php include_once('_php/conn.php'); if (isset($_POST[...
asked by 29.12.2016 / 18:16
1
answer

Error selecting bank "Error in database selected" [closed]

I was doing a comment system, but it is giving error:    Error in database selected Code: <?php $link=mysqli_connect("127.0.0.1","root",""); $banco=mysqli_select_db($link,"bdcomentario"); ?> <form name='form' method="post" acti...
asked by 10.11.2016 / 20:13
1
answer

php - Does not update in boolean field

I'm trying to update user data, but the active field is not updated. I have tried several changes and also changed the value of the variable $active from boolean to int , but without success. Another behavior I noticed...
asked by 06.06.2016 / 02:35
1
answer

MySQLi Can not pass parameter 2 by reference

Colleagues. I have the following code below: $conexao = new mysqli('127.0.0.1','root','','teste'); if(mysqli_connect_errno()) die(trigger_error(mysqli_connect_errno())); $cadastrar = $conexao->prepare("INSERT INTO cad_produtos VALUES(?...
asked by 01.03.2016 / 17:35
1
answer

Error printing mysql data [duplicate]

Good afternoon! I'm listing some mysql data using php; but when displayed in place of words that are accentuated I see characters like these . My schema and table are configured with charset utf8_general_ci . And in my html docume...
asked by 28.12.2015 / 17:51
2
answers

How to group results from a row-to-column query

Good afternoon, I have this query SELECT tblcliente.idCliente, tblclienterespostapre.resposta FROM tblcliente INNER JOIN tblclienterespostapre ON tblclienteresp...
asked by 28.10.2015 / 16:18
1
answer

Display mysqli error using die

I used mysql_query , as it is not used anymore I am using MySQLi . With this I was left with a doubt. To display the query error by DIE is this how it is done? $sql = $mysqli->query("SELECT * Fron tabela") or die(my...
asked by 06.01.2016 / 15:55
2
answers

Message to user after header change

I have a small problem with PHP, I need to redirect the user, but I wanted to notify you of what happened, I redirect it with header() , but if I try to send something before header fails, Any tips on how I can send a message to...
asked by 03.12.2015 / 05:01
1
answer

What is the equivalent of mysql_result in mysqli?

How can I make a FOR in php using mysqli ? I've always been able to do this: for($i=0; $i < $qtde; $i++){ $pet_id = **mysql_result**($dadosPets, $i, 'animal_id'); } How do I do the same, however, with mysqli ?  ...
asked by 22.08.2015 / 02:42