I made this project on my laptop and it works fine. I wanted to get it to work on my phone so I downloaded a web server (AWebServer) onto my phone (android). When I opened the file on my phone I got this error: Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)
.
It says the error is on the second to last line of this block of code:
<?php
require_once "conexion.php";
// la clase modelo hereda la informacionde Conexion
class Modelo extends Conexion
{
// #metodo para obtener la informacion de las ordehes.
static public function listadoOrdenesModelo($tabla)
{
$tabla = "orden_servicio";
$consulta = Conexion::conectar()->prepare("SELECT id, nombre, id_vendedor, id_sucursal, serie, fecha_orden, estatus_proceso FROM orden_servicio WHERE estatus_proceso IS NOT NULL ORDER BY fecha_orden ASC");
$consulta -> execute();
#retornamos lo que tiene la variable consulta, retorna todods los registros
return $consulta->fetchAll();
consulta->close;
}
I checked the PHP version on my laptop and it says it is PHP 8.2.4 and on AWebServer PHP 7.3.10. I did a bit of googling and apparently the error only pops up when then the PHP version is 5.6 or older.