Foros del Web » Programando para Internet » PHP »

Problema con PHP en dreamweaver

Estas en el tema de Problema con PHP en dreamweaver en el foro de PHP en Foros del Web. Buenas noches, necesitaba si algun entendido me puede ayudar, estoy trabajando en php con base mysql en dreamweaver, genero una consulta a la base y ...
  #1 (permalink)  
Antiguo 30/03/2009, 16:16
 
Fecha de Ingreso: noviembre-2008
Mensajes: 9
Antigüedad: 15 años, 5 meses
Puntos: 0
Problema con PHP en dreamweaver

Buenas noches, necesitaba si algun entendido me puede ayudar, estoy trabajando en php con base mysql en dreamweaver, genero una consulta a la base y cuando la testeo con me arroja los valores que esperaba.
El inconveniente es que cuando intento ver la pagina php en el explorador me arroja un mensaje de error en la linea 32 de mi codigo

Mi codigo es el siguiente:

<?php require_once('Connections/conection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

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;
}

mysql_select_db($database_conection, $conection);
$query_cuentaclientes = "SELECT IF(f.Comprobante=t1.minimo and OrdenCobro=0,clientes.RazonSocial,"") as cliente,IF(f.Comprobante=t1.minimo and OrdenCobro=0,f.CUIT,"") as CUIT2,f.CUIT, f.Comprobante, f.Total, IF(f.Comprobante=t1.minimo and OrdenCobro=0,t1.saldocliente,"") as saldo FROM facturaclientes f JOIN (SELECT CUIT, Comprobante,SUM(Total) as saldocliente, MIN(Comprobante) as minimo FROM facturaclientes GROUP BY CUIT)t1 JOIN clientes on f.CUIT=t1.CUIT and f.CUIT=clientes.CUIT ORDER BY f.CUIT, f.Comprobante";
$cuentaclientes = mysql_query($query_cuentaclientes, $conection) or die(mysql_error());
$row_cuentaclientes = mysql_fetch_assoc($cuentaclientes);
$totalRows_cuentaclientes = mysql_num_rows($cuentaclientes);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table border="0">
<tr>
<td>cliente</td>
<td>CUIT2</td>
<td>CUIT</td>
<td>Comprobante</td>
<td>Total</td>
<td>saldo</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_cuentaclientes['cliente']; ?></td>
<td><?php echo $row_cuentaclientes['CUIT2']; ?></td>
<td><?php echo $row_cuentaclientes['CUIT']; ?></td>
<td><?php echo $row_cuentaclientes['Comprobante']; ?></td>
<td><?php echo $row_cuentaclientes['Total']; ?></td>
<td><?php echo $row_cuentaclientes['saldo']; ?></td>
</tr>
<?php } while ($row_cuentaclientes = mysql_fetch_assoc($cuentaclientes)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($cuentaclientes);
?>
  #2 (permalink)  
Antiguo 30/03/2009, 16:39
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Problema con PHP en dreamweaver

Cita:
Iniciado por periosol
$query_cuentaclientes = "SELECT IF(f.Comprobante=t1.minimo and OrdenCobro=0,clientes.RazonSocial,"") as cliente,IF(f.Comprobante=t1.minimo and OrdenCobro=0,f.CUIT,"") as CUIT2,f.CUIT, f.Comprobante, f.Total, IF(f.Comprobante=t1.minimo and OrdenCobro=0,t1.saldocliente,"") as saldo FROM facturaclientes f JOIN (SELECT CUIT, Comprobante,SUM(Total) as saldocliente, MIN(Comprobante) as minimo FROM facturaclientes GROUP BY CUIT)t1 JOIN clientes on f.CUIT=t1.CUIT and f.CUIT=clientes.CUIT ORDER BY f.CUIT, f.Comprobante";
Esas comillas dobles hacen que la cadena finalice y vuelves a crear otra. Tienes dos opciones, la mas conveniente es cambiarlas por comillas sencillas y la otra es escaparlas: \"\" pero no le veo caso.

Lee por favor: http://www.forosdelweb.com/f18/como-...1/#post2414268
__________________
- León, Guanajuato
- GV-Foto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:02.