codice:
<?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_comunicazioni, $comunicazioni);
$query_rsComunicazione = "SELECT * FROM comunicazioni";
$rsComunicazione = mysql_query($query_rsComunicazione, $comunicazioni) or die(mysql_error());
$row_rsComunicazione = mysql_fetch_assoc($rsComunicazione);
$totalRows_rsComunicazione = mysql_num_rows($rsComunicazione);
?>
il database invece è strutturato cosi:
id int(11) not null auto_increment
filecomunicazione text null
titolo text null
comunicazione text null