如何檢查使用的查詢是更新我的桌子做或不使用PHP如何檢查更新使用PHP
下面是我的代碼
$sql_query = "update companies set
first_name = '$first_name',
last_name = '$last_name',
designation = '$designation',
company_name = '$company_name',
street_address = '$street_address',
city_code = '$city_code',
telephone_number = '$telephone_number',
mobile_number = '$mobile_number',
fax_number = '$fax_number'
where company_code='1001';";
if (!mysqli_query($conn_1,$sql_query))
{
$_SESSION['error_details'][0] = 'no';
$_SESSION['error_details'][1] = 'Sorry, not update!';
}
else
{
$_SESSION['error_details'][0] = 'yes';
$_SESSION['error_details'][1] = 'Thank you, update sucessfully!';
}
如何「如果條件」檢查此更新
'如果($ _ SESSION [ 'ERROR_DETAILS'] [0] == '是'){//更新發生}其他{//更新未發生}'? – Sean
手冊中沒有提到有關錯誤處理的任何信息嗎? –