Good morning! I am with this code and I support the site, out of nowhere this error started to appear: (
public function getUrlcliente($cliente_id) {
$parametro = "cliente_id=" . (int)$cliente_id;
$url_cliente = $this->db->query("SELECT DISTINCT query as indice, keyword as url FROM url_cliente WHERE query = '" . $parametro . "'");
if (empty($url_cliente)) {
$url = "Erro - URL cliente não cadastrada";
}
else {
foreach ($url_cliente as $row) {
$url = $row->url;
}
if ($url_cliente->num_rows) {
return $url;
}
else
{
return "Erro-Url inexistente";
}
}
public function getcliente($cliente_id) { // Dá erro nesta linha ** Parse error: syntax error, unexpected 'public' (T_PUBLIC) in ....
$url_ex = $this->getUrlcliente($cliente_id);
$query = $this->db->query("SELECT DISTINCT *, p.name AS name, p.image, '" . $this->getUrlcliente($cliente_id) . "' AS url_externa FROM cliente p";
if ($query->num_rows) {
return array(
'cliente_id' => $query->row['cliente_id'],
'name' => $query->row['name'],
'image ' => $query->row['image'],
'url_externa' => $query->row['url_externa'],
'meta_description' => $query->row['meta_description'],
'meta_keyword' => $query->row['meta_keyword'],
'tag' => $query->row['tag']
);
} else {
return false;
}
}
}
I can not find the reason for the error.