Hola haber si voy por buen o mal camino ? tengo este 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 = 10;
$pageNum_ofertas = 0;
if (isset($_GET['pageNum_ofertas'])) { $pageNum_ofertas = $_GET['pageNum_ofertas'];
}
$startRow_ofertas = $pageNum_ofertas * $maxRows_ofertas;
$query_ofertas = "SELECT DATEDIFF ( ofertas.fecha_de_cierre, ofertas.fecha_de_inicio) 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;
?>
<table border="1">
<tr>
<td>DATEDIFF (ofertas.fecha_de_inicio</td>
<td>int</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_ofertas['DATEDIFF (ofertas.fecha_de_cierre']; ?></td>
<td><?php echo $row_ofertas['int']; ?></td>
</tr>
</table>
por ahora no sale lo deseado, me da este error :
Código HTML:
Ver originalWarning: mysql_fetch_assoc(): 4 is not a valid MySQL result resource in C:\xampp\htdocs\Untitled-1.php on line 68
;
DATEDIFF (ofertas.fecha_de_inicio int
Notice: Undefined index: DATEDIFF (ofertas.fecha_de_cierre in C:\xampp\htdocs\Untitled-1.php on line 65
Notice: Undefined index: int in C:\xampp\htdocs\Untitled-1.php on line 66