Deletes are not allowed unless they contain a “where” or “like” clause |
[eluser]pakistanihaider[/eluser]
Getting Database Error. Code: Deletes are not allowed unless they contain a "where" or "like" clause. Also Posted the question on StackOverflow. Am I doing it the wrong way, if so then please tell the right way to delete data from database using both where and where_in conditions. Question Posted On Stackoverflow I dont know about forum rules moderator, if it is prohibited posting the stackoverflow link then surely you can delete the link, but please don't delete the question. Here is my Code. i tried both ways. 1. Code: function multiple_delete($tbl,$field,$values,$where) 2. Code: function multiple_delete($tbl,$field,$values,$where) Also tried like this. Code: function multiple_delete($tbl,$field,$values,$where) But no success so far. Here is the data that i am sending. Code: $tbl = 'sys_forms_in_groups'; where $value has this array Code: Array ( [0] => 6 [1] => 7 [2] => 23 [3] => 41 ) Please tell how should i implement this query in codeigniter? i have found nothing in docs about this. Also Searched google.
[eluser]larsonator[/eluser]
Taken from the Active Records Manual Page Quote:The first parameter is the table name, the second is the where clause. You can also use the where() or or_where() functions instead of passing the data to the second parameter of the function My guess is that the delete function doesnt utilise where_in. I way to test this out is to write the following code after you use the delete function Code: echo "<pre>"; possible work around would be Code: foreach($value as $v){ |
Welcome Guest, Not a member yet? Register Sign In |