Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/01/2005, 12:14
Avatar de christopher1979
christopher1979
 
Fecha de Ingreso: octubre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Exclamación codigo completo

hola fulano:

este es el codigo completo:


<?php

$clavefrente = $_POST['clavefrente'];

$nombrefrente = $_POST['nombrefrente'];

$clavepresupuesto = $_POST['clavepresupuesto'];

$descpresupuesto = $_POST['descpresupuesto'];

$clavepartida = $_POST['clavepartida'];

$connection = mysql_connect("localhost","administrador","adminis trador");

mysql_select_db("destajos",$connection);

aqui va lo de las concultas $resp = mysql_query("SELECT * FROM conceptospres where clavefrente = '$clavefrente' and clavepresupuesto = '$clavepresupuesto' and descpresupuesto = '$descpresupuesto'",$connection);

y la otra consulta es lo mismo pero con un aditamento mas

$resp = mysql_query("SELECT * FROM conceptospres where clavefrente = '$clavefrente' and clavepresupuesto = '$clavepresupuesto' and descpresupuesto = '$descpresupuesto' and clavepartida = '$clavapartida'",$connection);

lo que quiero es que aga las dos consultas solo que cuando traiga el valor la
variable $clavepartida = --->SELECCIONE PARTIDA<--- no ejecute la que contiene clave partida sino que ejecute la primera y si trai otro dato que ejecute la que contiene clavepartida




echo "<table>";

echo "<tr><td><font color = \"blue\" size = \"4\" face = \"arial\"><b>MODIFICAR Y ELIMINAR PRESUPUESTO (PASO 2)<b></font></td></tr></table><br><br>";

echo "<table>";

echo "<tr><td><font color = \"blue\" size = \"3\" face = \"tmes new romans\"><b>FRENTE:</b></font><td><font color =\"green\" size = \"3\" face = \"arial\"><b>$clavefrente-$nombrefrente</b></td></tr>";

echo "<tr><td><font color = \"blue\" size = \"3\" face = \"times new romans\"><b>PRESUPUESTO:</b></font><td><font color = \"green\" size = \"3\" face = \"arial\"><b>$descpresupuesto</b></font></td></tr>";

echo"</table><br><br>";

echo "<table border>";

echo "<tr><th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>CLAVE PARTIDA</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>CLAVE CONCEPTO</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>DESCRIPCION CONCEPTO</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>UNIDAD</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>CANTIDAD</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>PRECIO UNITARIO</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>IMPORTE</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>MODIFICAR</b></font></th>";

echo "<th bgcolor = \"black\"><font color = \"white\" size = \"2\" face = \"times new romans\"><b>ELIMINAR</b></font></th></tr>";

echo "<form name = \"modificar\" method = \"POST\" action = \"modificardatospresupuesto.php\">";

while($rows = mysql_fetch_assoc($resulpre)){

echo "<tr><td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[clavepartida]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[claveconcepto]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[descconcepto]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[unidad]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[cantidad]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[pu]</font></td>";

echo "<td align = \"center\"><font size = \"1\" face = \"times new romans\">$rows[importe]</font></td>";

echo "<td align = \"center\"><input type = \"image\" src = \"modificar.bmp\" alt = \"Modificar Registro\"></td>";

echo "</form>";

echo "<form name = \"eliminardatopresup\" method = \"POST\" action = \"\">";

echo "<td align = \"center\"><input type = \"image\" src = \"bote.bmp\" alt = \"Eliminar Registro\"></td></tr>";

echo "<input type = \"hidden\" name = \"clavefrente\" value = \"$clavefrente\">";

echo "<input type = \"hidden\" name = \"nombrefrente\" value = \"$nombrefrente\">";

echo "<input type = \"hidden\" name = \"clavepresupuesto\" value = \"clavepresupuesto\">";


}






?>