SoilentRed
Caaan do!
I'm testing the scheduler. Having fun with it. I was able to change a 0 to a 1 running the job.
Now I'm trying to trigger a text message, but whenever I run the cron, I'm given an error 500. I'm not sure how to go about debugging this.
Here is my code in case ya'll have any ideas
Now I'm trying to trigger a text message, but whenever I run the cron, I'm given an error 500. I'm not sure how to go about debugging this.
Here is my code in case ya'll have any ideas
Code:
require __DIR__ . '/vendor/autoload.php';
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$account_sid = 'ACsdsfdshgjfyytgvxbcdthjgbvsfdsgbv'; // not my real sid
$auth_token = 'fdskfdsjkfjdlksjfslkiropewriwepk'; //also fake
// In production, these should be environment variables. E.g.:
// $auth_token = $_ENV["TWILIO_AUTH_TOKEN"]
// A Twilio number you own with SMS capabilities
$twilio_number = "+19035555555";
$client = new Client($account_sid, $auth_token);
$client->messages->create(
// Where to send a text message (your cell phone?)
'+8325555555',
array(
'from' => $twilio_number,
'body' => 'I sent this message in under 10 minutes!'
)
);
*/
// Get the db object
$myDb = JFactory::getDbo();
// Build the query ? Tables names = CASE SENSITIVE
$myQuery = $myDb->getQuery(true);
$myQuery
-> update('txt')
-> set('txt.status = 1')
-> where('txt.status = 0');
$myDb->setQuery($myQuery);
// Run the query
// $found = (int)
$myDb->execute();
//use $myDb->query() in Joomla2.5
// var_dump($data);