Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 46881

Re: Field 'sender_id' does not have a default value - Moodle 2.4

$
0
0
by Qurrat Babar.  

sender_id is the $USER->id, the id of the user currently logged in.

The piece of code is as below:

$contact = new stdClass();
$contact->Msg_Id = $sms->Msg_Id;
$contact->sender_id = $USER->id;

$contact->contacts = $phone;
$contact->Date = date("Y-m-d H:m:s");
$contact->Status = 'pending';
$contact->Retrys = '0';

$contact->id = $DB->insert_record("sms_contacts", $contact);

sms_contacts is a custom table in my moodle db.


Viewing all articles
Browse latest Browse all 46881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>