el problema consiste en que la uso, pero no me devuelve nada pero tampoco da error aca se las pongo para que me digan que estoy haciendo mal
Código PHP:
<?php
//Clase de consulta
class DB_Query{
var $database="infomed";
var $query;
var $handle;
var $result;
var $countRecords=0;
function DB_Query($server,$user,$clave){
$this->handle = mysql_pconnect($server, $user, $clave) or die(mysql_error());
}
function execute($sql_string){
mysql_select_db($this->database, $this->handle);
$this->result = mysql_query($sql_string, $this->handle);
$this->countRecords = mysql_num_rows($this->result);
return $this->result;
}
function update($sql_string){
mysql_select_db($this->database, $this->handle);
mysql_query($sql_string, $this->handle);
return mysql_affected_rows($this->handle);
}
function close(){
return mysql_close($this->handle);
}
}
?>
Código PHP:
<?
include("connect.php");
$noticias = new DB_Query("localhost","root","");
$productos = $noticias->execute("SELECT id FROM actualidad ORDER BY id DESC LIMIT 0,1");
echo $productos[0];
$noticias->close();
?>
Saludos Alexjnm