Ver Mensaje Individual
  #14 (permalink)  
Antiguo 30/10/2012, 21:02
Avatar de rottenp4nx
rottenp4nx
 
Fecha de Ingreso: octubre-2012
Ubicación: Santiago
Mensajes: 417
Antigüedad: 11 años, 6 meses
Puntos: 36
Respuesta: Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)

Trata de hacerlo así, te darás cuenta donde puede estar el error

Código PHP:
<?php
    $mysqli 
= new mysqli('localhost','root','','midb');
    
$consulta "select titulo from contenido order by id_cont desc limit 5";
    if(!
$sentencia $mysqli->prepare($consulta))
        echo 
$mysqli->error;
    if(!
$sentencia->execute())
        echo 
$mysqli->error;
    if(!
$sentencia->bind_result($titulo))
        echo 
$mysqli->error;
    while(
$sentencia->fetch()){
    echo 
$titulo."<br>";
    }
    
$mysqli->close();
    
?>
Espero que te ayude el ejemplo, Saludos