Object of class UserInbox could not be converted to string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
javasac
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 7:10 pm

Object of class UserInbox could not be converted to string

Post by javasac »

I KEEP GETTING THIS ERROR when adding a record. Please advice.

Catchable fatal error: Object of class UserInbox could not be converted to string in C:\wamp\ZendFramework-1.0.4\library\Zend\Db\Statement\Pdo.php on line 221

<?php
require_once('Zend/Date.php');

// this class fetches the private messages from the t_inbox table
class UserInbox extends Zend_Db_Table
{
protected $_name = 't_inbox';

public function postPrivateMessage($senderId, $receiverId, $zoneId, $sub, $msg, $msgType)
{
$logger = Zend_Registry::get(YoConstants::REGKEY_LOGGER);

$logger->debug('SUBJECT IS ' . $sub);
$date = Zend_Date::now();

$data = array(
'sender_id' => $senderId,
'receiver_id' => $receiverId,
'zone_id' => $zoneId,
'msgDate' => $date->toString(),
'message_type' => $msgType,
'message_text' => $msg,
'subject' => $sub,
'msg_read' => 'no',
'status' => '0'
);

$table = new UserInbox();
$table->insert($data);
}

}
?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Object of class UserInbox could not be converted to string

Post by John Cartwright »

Posting identical threads in 4 different forums is not cool man. Consider this a warning.
javasac
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 7:10 pm

Re: Object of class UserInbox could not be converted to string

Post by javasac »

just wanted an answer ASAP.....sorry for that.
javasac
Forum Newbie
Posts: 7
Joined: Thu Apr 03, 2008 7:10 pm

Re: Object of class UserInbox could not be converted to string

Post by javasac »

can you please let me know which is the best forum to get an answer to this question?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Object of class UserInbox could not be converted to string

Post by John Cartwright »

Our forum rules only allow you to bump after 24 hours of your last post.

Please read our forum rules, viewtopic.php?f=6&t=30037, before posting again.

Consider this a second warning.

EDIT | Like I said I removed all the topics and left this one (before it was in the correct forum)
Post Reply