ahora logre que me diga esta subasta termina en xxxx :
este es el script :
Código PHP:
Ver original<?php require('/Connections/hoysale.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_ofertas = 3;
$pageNum_ofertas = 0;
if (isset($_GET['pageNum_ofertas'])) { $pageNum_ofertas = $_GET['pageNum_ofertas'];
}
$startRow_ofertas = $pageNum_ofertas * $maxRows_ofertas;
$query_ofertas = "SELECT * FROM ofertas";
$query_limit_ofertas = sprintf("%s LIMIT %d, %d", $query_ofertas, $startRow_ofertas, $maxRows_ofertas);
if (isset($_GET['totalRows_ofertas'])) { $totalRows_ofertas = $_GET['totalRows_ofertas'];
} else {
}
$totalPages_ofertas = ceil($totalRows_ofertas/$maxRows_ofertas)-1;
$target_time = mktime ('08:47:35');
$difference = ($target_time -$current_time);
$time = (int) ($difference/$row_ofertas['fecha_de_cierre']);
print "esta subasta termina en '$time' horas";
?>
<table border="1">
<tr>
<td>fecha_de_inicio</td>
<td>fecha_de_cierre</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_ofertas['fecha_de_inicio']; ?></td>
<td><?php echo $row_ofertas['fecha_de_cierre']; ?></td>
</tr>
</table>
me salen estos dos errores :
Código PHP:
Ver originalNotice: A non well formed numeric value encountered in C:\xampp\htdocs\Untitled-1.php on line 56
esta subasta termina en '-2880' horas
fecha_de_inicio fecha_de_cierre
2012-11-07 08:47:35 10/11/2012 23:59
Warning
: mysql_fetch_assoc(): 4 is not a valid
MySQL result resource in C
:\xampp\htdocs\Untitled
-1.php on line
81