1
someone knows how to fix an error in the
$stmt = mysqli_prepare($mysqli, $sql);
mysqli_stmt_bind_param($stmt, 'i', $id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
it does not bring the proposed function in the hosting of Locaweb. I decided to give a var dump in my localhost
and he brings me the results but in Ocaweb he does not bring me those results. I read that it could be the version by which in Ocaweb the default and version 5.2 of php
intao I changed the version to the 5.6 but nothing appears the results someone could help me?
good on my detail page has this code:
$id = $_GET['cod'];
$sqql = mysqli_query($mysqli, "SELECT * FROM produtos WHERE id_produto = $id");
$test = mysqli_query($mysqli, "SELECT votos, pontos FROM produtos WHERE id_produto = $id");
$aux = mysqli_fetch_array($sqql);
$idprod = $aux['id_produto'];
$row = mysqli_fetch_array($test);
$voto = $row['votos'];
$ponto = $row['pontos'];
$calc = round(($ponto/$voto),1);
until this section is working because I gave var_dump($idprod)
and it returns me the id of the right product but continuing now has the part that brings the result:
$sql = "SELECT * FROM produtos WHERE id_produto = ?";
$stmt = mysqli_prepare($mysqli, $sql);
mysqli_stmt_bind_param($stmt, 'i', $id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
while ($aqq = mysqli_fetch_assoc($result)){
$nome = $aqq['nome'];
$desc = $aqq['descricao'];
$preco = $aqq['preco'];
$img = $aqq['img'];
already here in this passage I gave var_dump($nome)
it would be right for him to show me string aaaa but he won’t show me anything in Ocaweb, but I will run the same var_dump
on my localhost and even at the same location there it returns me string aaaa
What error happens? if php5.2 is the default I would urgently change hosting.
– rray
does not show the error simply does not show my products anything related I vardump in it see what happened and nothing shows in the vardump already in localhost shows me the results of the vardump
– Leonardo Costa
At the top of the page put these two lines,
ini_set('display_errors', true); error_reporting(E_ALL);
– rray
@rray would have some other way of using the method that returns the result to test if it really is the error? something that makes the same as mysql_result
– Leonardo Costa
Try to see the apache logs.
– rray
Call to undefined function mysqli_stmt_get_result() in /home/storage/d/8a/28/hospedagemdes1002/public_html/detalhe.php on line 324
– Leonardo Costa
You need mysql installed, http://php.net/manual/en/book.mysqlnd.php need to ask them to enable
– rray
I just asked them and that’s it?
– Leonardo Costa
In theory yes, send the manual link to them, explains q to work your code need this feature enabled
– rray