[英]Unable to delete rows from table based on condition
我一直在嘗試根據第一個表中的條件從第二個表中刪除所有記錄。 但是它不起作用。 當我嘗試無條件刪除記錄時。 它工作正常,記錄被刪除。 不知道是什么問題
if(!is_null(Input::get('id'))) {
$dates= DB::table('feedates')->where('feeCategory', '=', $ID)->count();
if($dates == $freq) {
$x = DB::table('feedates')->where('feeCategory', '=', $ID)->delete();
}
}
我正在將php Laravel與mysql一起使用
子DeleteRowBasedOnCriteria()
Dim RowToTest As Long
For RowToTest = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
With Cells(RowToTest, 5)
If .Value <> "Test" Then Rows(RowToTest).EntireRow.Delete
End With
Next RowToTest
結束子
每當您必須在Laravel中進行MYSQL操作時,嘗試在cmd或IDE控制台的shell腳本中使用修補程序時,對於您的所有查詢無疑都將有所幫助。 並在查詢操作中使用save()函數。 希望對您有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.