我正在使用Dreamweaver构建我的PHP/MySQL站点,因为我的技能相当小,我想将选项从多选项下拉列表保存到$_SESSION变量.我在前一页上使用以下内容更新数据库中的字段时成功设法保存到会话变量并且似乎正在工作(Dreamweaver插入的页面顶部,我评论了我编辑它以使其存储到的位置的$_SESSION):
<?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 != "") ? …Run Code Online (Sandbox Code Playgroud)