0
我使用下面的代碼將數據插入到mysql數據庫PHP的下拉菜單
<?php
$refselect = $_POST['refselect'];
$refname = $_POST['refname'];
$refemail = $_POST['refemail'];
$refcnt = $_POST['refcnt'];
$refdes = $_POST['refdes'];
$referror = $cberror = "<h1>Data not Added</h1><br/><br/><h3>Please Follow The Instructions</h3>";
$urefdb = "INSERT INTO refdb(reftype,refname,refemail,refcnt,refdes) VALUES ('$refselect','$refname','$refemail','$refcnt','$refdes');";
include_once("db.php");
if ($refselect == "Select Type") die ("$referror");
if (empty ($refname)) die ("$referror");
if (mysql_query("$urefdb"))
{
echo "<h3>One Record Updated Successfully with the following Details </h3><br/>";
echo "Reference Type =$refselect <br/><br/>";
echo "Reference Name = $refname <br/><br/>";
echo "Reference E-Mail = $refemail <br/><br/>";
echo "Reference Description = $refdes <br/><br/>";
}
else
{
echo mysql_error();
}
?>
「refselect」數據是從下拉頁面菜單來了,我想,當我通過這種形式添加數據另一個表格位於另一個頁面圖片「refname」從數據庫中,當我更新「refdb」時,下拉菜單相應地選取數據
現在該做什麼?
什麼?如果你用多個句子來描述你在做什麼,這將會有所幫助。 – 2010-01-04 17:02:25
確保清理用戶輸入! – Neddy 2011-03-31 09:26:06