Codice PHP:
<?php require_once('../../Connections/pastauovo.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;
}
}
$colname_DetailRS1 = "-1";
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = $_GET['recordID'];
}
mysql_select_db($database_pastauovo, $pastauovo);
$query_DetailRS1 = sprintf("SELECT * FROM preventivi WHERE ID = %s", GetSQLValueString($colname_DetailRS1, "int"));
$DetailRS1 = mysql_query($query_DetailRS1, $pastauovo) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($DetailRS1);
?>
<form id="form2" name="form2" method="post" action="">
<?php while ($row_DetailRS1 = mysql_fetch_assoc($DetailRS1));
{
echo $row_DetailRS1['Aperitivi'];
echo "<input type=\"checkbox\" name=\"Maychek\"id=\"Maychek\" /> <label for=\"Maychek\"></label>";
} ?>
</form>
ho creato una tabella nel tatabase ho assegnato id 1 a tutti gli aperitivi
ho ricreato la query
ma il risultato non cambia vedo i prodotti ma non le check