Good afternoon I find the following error, I want to get a result of an SQL query to a local DB make a php file with the class and its function, and make an html file so that I can present it but it indicates me error // arhivo php for the connection
<?php
class conexion {
function restantes(){
$enlace = mysql_connect('localhost', 'root', 'admin');
if (!$enlace) {
die('No se pudo conectar : ' . mysql_error());
}
$bd_seleccionada = mysql_select_db('Kupon', $enlace);
if (!$bd_seleccionada) {
die ('No se puede usar Kupon : ' .mysql_error());
}
$query = ' SELECT * FROM wp_postmeta ' ;
$resultado = mysql_query($query);
while ($fila = mysql_fetch_array($resultado)) {
echo "$fila [meta_value]";
}
}
}
?>
in HTML I send it to call like this
<?php
include("conexion.php");
$enlace = new conexion();
$enlace ->restantes();
?>
grcias