Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/06/2008, 09:32
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 17 años
Puntos: 300
Respuesta: Problema Resultado Siempre Presente

He probado con PHP y a mí me funciona el script siguiente:
Código:
<?php 
$link = mysql_connect ('localhost', 'uno', 'otro');
	if (!$link){
		echo 'error al conectar';
		die;
	}
	$bd = mysql_select_db('diegoluisr');
	if (!$bd){
		echo 'error al seleccionar la base d datos';
		die;
	}
	mysql_query ("SET NAMES 'utf8'"); 


function getLastId(){
		$query= "SELECT id FROM article WHERE article_type = 1 ORDER BY apointmentdate DESC LIMIT 1";
		$getid=mysql_query($query);
		if (mysql_num_rows($getid)>0){
			$arr_array = mysql_fetch_array($getid);
			return $arr_array[0]['id'];
		} else {
			return 0;
		}
	}
	echo getLastId();
?>
Comprueba las versiones de PHP que usas en local y la del servidor, y la sintaxis de tu PHP

Última edición por jurena; 25/06/2008 a las 09:44