01-05-2019, 06:10 PM
I can't figure out how to solve a right query, what do I wrong?
sql query:
DELETE FROM `tbl_resource` WHERE (`ID_resource`=".$var1." AND `ID_veld`=".$var2." AND `type_resource`='P') LIMIT 1;
first try:
$db->delete("tbl_resource",
[ "AND",
["ID_resource","=",$db->result()[0]->ID_papo],
["ID_veld", "=", $lesblokId ],
["type_resource", "=", "P"]
]);
second try:
$db->delete("tbl_resource",
[ "AND",
[ "AND",[
["ID_resource","=",$db->result()[0]->ID_papo],
["ID_veld", "=", $lesblokId ]
],
["type_resource", "=", "P"]
]
]);
sql query:
DELETE FROM `tbl_resource` WHERE (`ID_resource`=".$var1." AND `ID_veld`=".$var2." AND `type_resource`='P') LIMIT 1;
first try:
$db->delete("tbl_resource",
[ "AND",
["ID_resource","=",$db->result()[0]->ID_papo],
["ID_veld", "=", $lesblokId ],
["type_resource", "=", "P"]
]);
second try:
$db->delete("tbl_resource",
[ "AND",
[ "AND",[
["ID_resource","=",$db->result()[0]->ID_papo],
["ID_veld", "=", $lesblokId ]
],
["type_resource", "=", "P"]
]
]);