Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/07/2015, 13:00
mauricio1020
 
Fecha de Ingreso: mayo-2015
Mensajes: 63
Antigüedad: 9 años
Puntos: 1
Respuesta: Consultas mysqli en php

hola gracias por responder he puesto lo que me dices en la funcion get_visitas de la clase trabajo asi
public function get_visitas()
{
$conex=new Conectar ();
$con = $conex->con()


$sql="select * from libro_de_visitas";
$res = mysqli_query($con,$sql)or die(mysqli_error());


while ($reg=mysqli_fetch_assoc($res))
{
$this->visitas[]=$reg;
}
return $this->visitas;
}

pero el ide que trabajo me dice que hay un error en la linea:
$sql="select * from libro_de_visitas";
y al ejecutarlo me arroja:
Parse error: syntax error, unexpected '$sql' (T_VARIABLE) in C:\