safemode Posted June 6, 2018 Share Posted June 6, 2018 hi i have create modules that need to Updating rows in the DB or create new ones if (isset($_POST["pid"])) { try { $insert_array = [ "pid" => $_POST["pid"], "purchase" => $_POST["price"] ]; Capsule::table('rasanegarbulkprice') ->insert($insert_array); } catch(\Illuminate\Database\QueryException $ex){ echo $ex->getMessage(); } catch (Exception $e) { echo $e->getMessage(); } } this is my code that i use for inserting but i want to change it to IF exist update row or create it 0 Quote Link to comment Share on other sites More sharing options...
safemode Posted June 7, 2018 Author Share Posted June 7, 2018 hi why not approved my post ? i need it 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.