i have the following code
// Process your response here
$jsonData = json_decode($response);
if ($jsonData->status === 'success') {
// Grab Message ID
foreach($jsonData->messages as $txtid)
{
// Got Message ID
// Success code
echo ('Sent: message to '.$to.' appearing to be sent from '.$from.' <br><br> One Credit used.<br><br>');
}
// Insert Details to log
$sth2 = $db->prepare ("INSERT INTO logs (id,`to`,`from`,message,`txtid`) VALUES (:id,:to,:from,:message,:txtid)");
$sth2->bindParam(':id', $id, PDO::PARAM_INT);
$sth2->bindParam(':to', $to, PDO::PARAM_INT);
$sth2->bindParam(':from', $from, PDO::PARAM_INT);
$sth2->bindParam(':message', $message, PDO::PARAM_STR);
$sth2->bindParam(':txtid', $txtid, PDO::PARAM_STR);
$sth2->execute();
and i am getting the following error
Catchable fatal error: Object of class stdClass could not be converted to string in
i have tried txtid as PARAM_INIT and STR
the database is set to varchar and it the txtid will be numbers