Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/04/2012, 05:53
bombata
 
Fecha de Ingreso: abril-2012
Mensajes: 3
Antigüedad: 12 años
Puntos: 0
Respuesta: Tallas, como poner a la vez numeros y letras en php

Gracias por tu interes Karma , voy a poner la pagina productostalla a ver si podemos ver el problema.


<?php require_once('../Connections/conexionropa.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO tblproductotalla (relProducto, relTalla) VALUES (%s, %s)",
GetSQLValueString($_POST['relProducto'], "int"),
GetSQLValueString($_POST['relTalla'], "int"));

mysql_select_db($database_conexionropa, $conexionropa);
$Result1 = mysql_query($insertSQL, $conexionropa) or die(mysql_error());

$insertGoTo = "productotalla_lista.php?recordID=".$_POST['relProducto'];
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_conexionropa, $conexionropa);
$query_Recordset1 = "SELECT * FROM tbltallas WHERE tbltallas.strNombre";
$Recordset1 = mysql_query($query_Recordset1, $conexionropa) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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"><!-- InstanceBegin template="/Templates/BaseAdmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Administracion Principal Tienda de Ropa </title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="../estilo/principal.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="container">
<div class="header">
</div>
<!-- end .header --></div>
<div class="sidebar1">
<?php include("../includes/cabeceraadmin.php");
?>
<!-- end .sidebar1 --></div>
<div class="content">

<!-- end .content -->
<!-- InstanceBeginEditable name="Contenido" -->
<h1>A&ntilde;adir Talla a Producto</h1>
<p>&nbsp;</p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Talla:</td>
<td><select name="relTalla" size=<"1">
<?php
do {
?>
<option value="<?php echo $row_Recordset1['idTalla']?>" ><?php echo $row_Recordset1['strNombre']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
?>
</select></td>
</tr>
<tr> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="submit" value="Insertar Talla En Producto" />
</td>
</tr>
</table>
<input type="hidden" name="relProducto" value="<?php echo $_GET["recordID"]; ?>" />
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p>&nbsp;</p>
<!-- InstanceEndEditable --></div>
<div class="footer">
<p>Administracion Tienda Ropa</p>
<!-- end .footer --></div>
<!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($Recordset1);
?>



Gracias compañeros