2010-12-11 10 views
2

私はテーブルのいくつかのフィールドを更新するフォームを開発しましたが、提出するとクリアページが返されます。ここに私が提出のために使用しているコードがあります。更新フォームは空白ページを返します

$editFormAction = $_SERVER['PHP_SELF']; 
if (isset($_SERVER['QUERY_STRING'])) { 
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); 
} 

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form")) { 

    $doa_bits = explode('/', $_POST['doa']); 

    $updateSQL = sprintf("UPDATE tbl_personalinjury SET role=%s, driverNo=%s, clientName=%s, address=%s, residedYrs=%s, cntctSolicitor=%s, telephoneHome=%s, telephoneMobile=%s, time=%s, time2=%s, dobDay=%s, dobMonth=%s, dobYear=%s, maritalStatus=%s, job=%s, niNo=%s, doaDay=%s, doaMonth=%s, doaYear=%s, time3=%s, time4=%s, weather=%s, location=%s, policeDetail=%s, accidentDetail=%s, blame=%s, witnessDetail=%s, dName=%s, dAdd=%s, dvMake=%s, dvModel=%s, dReg=%s, dInsurance=%s, tName=%s, tAdd=%s, tvMake=%s, tvModel=%s, tReg=%s, tInsurance=%s, seatbelt=%s, injuries=%s, injuries2=%s, recover=%s, timeoff=%s, loss=%s, expenses=%s, sports=%s, hospital=%s, gpName=%s, gpAddress=%s WHERE id=$client_id", 
         GetSQLValueString($_POST['role'], "text"), 
         GetSQLValueString($_POST['driverNo'], "text"), 
         GetSQLValueString($_POST['clientName'], "text"), 
         GetSQLValueString($_POST['address'], "text"), 
         GetSQLValueString($_POST['residedYrs'], "text"), 
         GetSQLValueString($_POST['cntctSolicitor'], "text"), 
         GetSQLValueString($_POST['telephoneHome'], "text"), 
         GetSQLValueString($_POST['telephoneMobile'], "text"), 
         GetSQLValueString($_POST['time'], "text"), 
         GetSQLValueString($_POST['time2'], "text"), 
         GetSQLValueString($_POST['dobDay'], "text"), 
         GetSQLValueString($_POST['dobMonth'], "text"), 
         GetSQLValueString($_POST['dobYr'], "text"), 
         GetSQLValueString($_POST['maritalStatus'], "text"), 
         GetSQLValueString($_POST['job'], "text"), 
         GetSQLValueString($_POST['niNo'], "text"), 
         GetSQLValueString($doa_bits[0], "text"), 
         GetSQLValueString($doa_bits[1], "text"), 
         GetSQLValueString($doa_bits[2], "text"), 
         GetSQLValueString($_POST['time3'], "text"), 
         GetSQLValueString($_POST['time4'], "text"), 
         GetSQLValueString($_POST['weather'], "text"), 
         GetSQLValueString($_POST['location'], "text"), 
         GetSQLValueString($_POST['policeDetail'], "text"), 
         GetSQLValueString($_POST['accidentDetail'], "text"), 
         GetSQLValueString($_POST['blame'], "text"), 
         GetSQLValueString($_POST['witnessDetail'], "text"), 
         GetSQLValueString($_POST['dName'], "text"), 
         GetSQLValueString($_POST['dAdd'], "text"), 
         GetSQLValueString($_POST['dvMake'], "text"), 
         GetSQLValueString($_POST['dvModel'], "text"), 
         GetSQLValueString($_POST['dReg'], "text"), 
         GetSQLValueString($_POST['dInsurance'], "text"), 
         GetSQLValueString($_POST['tName'], "text"), 
         GetSQLValueString($_POST['tAdd'], "text"), 
         GetSQLValueString($_POST['tvMake'], "text"), 
         GetSQLValueString($_POST['tvModel'], "text"), 
         GetSQLValueString($_POST['tReg'], "text"), 
         GetSQLValueString($_POST['tInsurance'], "text"), 
         GetSQLValueString($_POST['seatbelt'], "text"), 
         GetSQLValueString($_POST['injuries'], "text"), 
         GetSQLValueString($_POST['injuries2'], "text"), 
         GetSQLValueString($_POST['recover'], "text"), 
         GetSQLValueString($_POST['timeoff'], "text"), 
         GetSQLValueString($_POST['loss'], "text"), 
         GetSQLValueString($_POST['expenses'], "text"), 
         GetSQLValueString($_POST['sports'], "text"), 
         GetSQLValueString($_POST['hospital'], "text"), 
         GetSQLValueString($_POST['gpName'], "text"), 
         GetSQLValueString($_POST['gpAddress'], "text"), 
         GetSQLValueString($_POST['driverNo'], "text")); 

    mysql_select_db($database_speedycms, $speedycms); 
    $Result1 = mysql_query($updateSQL, $speedycms) or die(mysql_error()); 
} 

mysql_select_db($database_speedycms, $speedycms); 
$query_accident = "SELECT * FROM tbl_personalinjury WHERE id=$client_id"; 
$accident = mysql_query($query_accident, $speedycms) or die(mysql_error()); 
$row_accident = mysql_fetch_assoc($accident); 
$totalRows_accident = mysql_num_rows($accident); 

どのような候補ですか?

+0

ここでの質問は正確ですか?あなたは 'print'する必要がある場合、SQL呼び出しに問題があるのか​​、ページに何かが印刷されることを期待していますか?何かがあります –

+0

私は何かがページに印刷されることを期待しています – methuselah

+1

エラーが無効であると仮定して出力を生成することができるのは、 'またはdie(mysql_error())' – BoltClock

答えて

3

あなたはテキストを出力する関数を呼び出していません。したがって、ページは空白です。そのような単純な。

ページが空白であることから、die(mysql_error())が実行されなかったためにクエリが正常に実行されたと想定すると、エラーが発生した場合にエラーメッセージが出力されます。

関連する問題