2017-12-24 6 views
-2

を削除しながら、私はエントリを削除しようとしている、しかし、常にこれらのエラーを取得しています:お知らせ:未定義のインデックス項目に

お知らせ:未定義のインデックス:wineTypeID /ストレージ内/ ssd5/3453765分の765/public_htmlの/ /ストレージ内wineSize /:ライン上 /storage/ssd5/765/3453765/public_html/wine_action.phpでwineName 34

注意:ライン上のwine_action.php 33

注意:未定義のインデックス不定インデックスssd5/765/3453765/public_html/wiライン上のne_action.php 35

お知らせ:未定義のインデックス: /storage/ssd5/765/3453765/public_html/wine_action.phpでwinePriceライン上の36

私のコードは、この

<?php 

// include the connection stream include 'connectYes.php'; 

// here are the two hiddent fields 

// they tell the script is this is an add, update or delete 

// and for an update and delete, they pass the id 

$action = $_REQUEST["action"]; 

$id = $_REQUEST["id"]; 

$wineTypeID = $_REQUEST["wineTypeID"]; 

$wineName = $_REQUEST["wineName"]; 

$wineSize = $_REQUEST["wineSize"]; 

$winePrice = $_REQUEST["winePrice"]; 

if ($action == 'a') { 

$query = "insert into WINE values (

null, 

'$wineTypeID', 

'$wineName', 

'$wineSize', 

'$winePrice' 

)"; 

mysqli_query($conn,$query) 

or die (mysqli_error()); 

print "<h3>The Item $wineName is added to the List</h3>"; 
" </h3>"; 

} 

if ($action == 'u') { 

$query = "update WINE 

set wineTypeID = '$wineTypeID', 

wineName = '$wineName', 

wineSize = '$wineSize', 

winePrice = '$winePrice' 

where wineID = '$id'"; 

mysqli_query($conn, $query) 

or  die(mysqli_error()); 

print "<h3>Update Successful</h3>"; 
} // end u 

if ($action == 'd') { 

$query = "delete from WINE 

where wineID = '$id'"; 

mysqli_query($conn, $query) 

    or die("query failed:" . mysqli_error()); 

print "<h3>Delete Successful</h3>"; 
} 

?>} 
のように見えます私のページへ

リンク: - 私のファイルにmy page

リンク: - Php Files

mysql構造体:Mysql structure

+3

[通知:未定義の変数]、[通知:未定義のインデックス]、および[通知:未定義のオフセット]](https://stackoverflow.com/questions/4261133/php-notice-undefined- variable-notice-undefined-indexおよびnotice-undef) –

答えて

0

"wineTypeID"パラメータが通過しているかどうかを確認してください。