intento con dreamweaver crear regiones repetidas, pero horizontalmente, que creo, es lo que necesito, no me deja hacerlo, o no se como.
de hecho he intentado para la primera fila, en l que solo deben salir dos resultados hacer la consulta con un limit 1,2, y da error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 2' at line 1
el código es este
Código PHP:
Ver original<?php require_once('Connections/conexxion.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;
}
}
$query_Recordset2 = "select venta,compra,taller,regula_mas,regula_menos,movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera from movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf group by movimiento.id_item order by esfera desc, cilindro desc;";
$query_solostock149nc = "SELECT movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera FROM movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf GROUP BY movimiento.id_item ORDER BY esfera desc, cilindro desc";
$query_stock1 = "select venta,compra,taller,regula_mas,regula_menos,movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera from movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf group by movimiento.id_item order by esfera desc, cilindro desc limit 1";
$maxRows_stock2 = 2;
$pageNum_stock2 = 0;
if (isset($_GET['pageNum_stock2'])) { $pageNum_stock2 = $_GET['pageNum_stock2'];
}
$startRow_stock2 = $pageNum_stock2 * $maxRows_stock2;
$query_stock2 = "SELECT venta,compra,taller,regula_mas,regula_menos,movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera FROM movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf GROUP BY movimiento.id_item ORDER BY esfera desc, cilindro desc limit 1,1";
$query_limit_stock2 = sprintf("%s LIMIT %d, %d", $query_stock2, $startRow_stock2, $maxRows_stock2);
if (isset($_GET['totalRows_stock2'])) { $totalRows_stock2 = $_GET['totalRows_stock2'];
} else {
}
$totalPages_stock2 = ceil($totalRows_stock2/$maxRows_stock2)-1;
$query_stock3 = "SELECT venta,compra,taller,regula_mas,regula_menos,movimiento.id_item,sum(compra+regula_mas-venta-taller-regula_menos) as stock, cilindro, esfera FROM movimiento join item on item.id_item=movimiento.id_item join rx on rx.id_rx=item.id_rx join cilindro on cilindro.id_cil=rx.id_cil join esfera on esfera.id_esf=rx.id_esf GROUP BY movimiento.id_item ORDER BY esfera desc, cilindro desc limit 2,2";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>1.49NC</title>
</head>
<body>
<p>pruebas</p>
<p> </p>
<p> </p>
<table width="80%" border="1">
<tr>
<td> </td>
<td>0.00</td>
<td>-0.25</td>
<td>-0.50</td>
<td>-0.75</td>
<td>-1.00</td>
<td>-1.25</td>
<td>-1.50</td>
<td>-1.75</td>
<td>-2.00</td>
</tr>
<tr>
<td>4.00</td>
<td><?php echo $row_stock1['stock']; ?></td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>3.75</td>
<td><?php do { ?>
<?php echo $row_stock2['stock']; ?>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>3.50</td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>3.25</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>3.00</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>2.75</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>2.50</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>2.25</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td bgcolor="#333333"> </td>
</tr>
<tr>
<td>2.00</td>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>1.75</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>1.50</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?php
?>