±M·~«Ç¤º¸ËæC³]p¡B«ν·s ¿Ä¦X¬ü·P»P¹ê¥Î¡A¥þ±Àç³y·ÅÄɦn¦v¡I | ¥þ¬ÙºûצU¤j«~µP§N®ð¡A¤£§N¡B¤£¶}¾÷¡B²§Án¦ÛÃö¾÷ §N®ð¾÷ºûסB¦w¸Ë¡B«O¾i¡AÅwªï¨Ó¹q¬¢½Í¬Ò¥i¬¢¸ß |
[±Ð¾Ç]°ÊºA¤T¼h¤U©Ô¦¡¿ï³æ |
©ÐªF¡G¤p°¨ µoªí®É¶¡¡G2010-01-31 | [ÀËÁ|] |
|
1 ¼Ó¦í¤á¡G¤p¤p µoªí®É¶¡¡G2010-01-31 | [ÀËÁ|] |
|
2 ¼Ó¦í¤á¡G¤pÄR µoªí®É¶¡¡G2010-02-26 | [ÀËÁ|] |
$hostname_dymenu_conn = "localhost"; $database_dymenu_conn = "cttlee"; $username_dymenu_conn = "cttlee"; $password_dymenu_conn = "cttlee"; $dymenu_conn = mysql_pconnect($hostname_dymenu_conn, $username_dymenu_conn, $password_dymenu_conn) or trigger_error(mysql_error(),E_USER_ERROR); mysql_query("SET NAMES utf8"); ?> 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']) . '&cttlee=male'; } else { $editFormAction .= "?cttlee=male"; } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1") && isset($_GET['cttlee'])) { $insertSQL = sprintf("INSERT INTO records (Name, Zip) VALUES (%s, %s)", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['zip'], "text")); //mysql_select_db($database_dymenu_conn, $dymenu_conn); //$Result1 = mysql_query($insertSQL, $dymenu_conn) or die(mysql_error()); $insertGoTo = "dymenu.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_dymenu_conn, $dymenu_conn); $query_rs_county = "SELECT * FROM county ORDER BY cID ASC"; $rs_county = mysql_query($query_rs_county, $dymenu_conn) or die(mysql_error()); $row_rs_county = mysql_fetch_assoc($rs_county); $totalRows_rs_county = mysql_num_rows($rs_county); $colname_rs_town = "-1"; if (isset($_POST['county'])) { $colname_rs_town = $_POST['county']; } mysql_select_db($database_dymenu_conn, $dymenu_conn); $query_rs_town = sprintf("SELECT * FROM town WHERE tCounty = %s", GetSQLValueString($colname_rs_town, "text")); $rs_town = mysql_query($query_rs_town, $dymenu_conn) or die(mysql_error()); $row_rs_town = mysql_fetch_assoc($rs_town); $totalRows_rs_town = mysql_num_rows($rs_town); $colname_rs_zip = "-1"; if (isset($_POST['town'])) { $colname_rs_zip = $_POST['town']; } mysql_select_db($database_dymenu_conn, $dymenu_conn); $query_rs_zip = sprintf("SELECT * FROM zip WHERE zTown = %s", GetSQLValueString($colname_rs_zip, "text")); $rs_zip = mysql_query($query_rs_zip, $dymenu_conn) or die(mysql_error()); $row_rs_zip = mysql_fetch_assoc($rs_zip); $totalRows_rs_zip = mysql_num_rows($rs_zip); ?> mysql_free_result($rs_county); mysql_free_result($rs_town); mysql_free_result($rs_zip); ?> county�o�Ӹ�ƪ���:cID,cName town��ƪ���:tID,tCounty,tName zip�o��ƪ���:zID,zTown,zName,zCode |