473,379 Members | 1,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

PDO catchable fatal error on prepare->execute()

gp
************************************************** ************************************************** **************************
Catchable fatal error: Object of class stdClass could not be
converted to string in <filenameon line <line>
************************************************** ************************************************** **************************

I can only find the change log for PHP 5.2 identifying this type of
error, nothing on how to fix it. I have updated PHP to 5.2.3 on
Apache 2.2.x on a BSD Box 6.x If some one could explain to me what I
am doing wrong, and what I need to do to fix it that would be swell.
A point of note is that my $dbh is being created in my class
constructor as a private. The method that is calling the prepare and
execute statements is a public. I don't thing I'm trying to do
anything new or exotic, I don't think I'm trying to convert the object
to a string, just execute the query statement....

$begin = $this->dbh->beginTransaction();
if (!$begin) throw new HWIException(ERR0023,23);

$outdc = "";
$outliid = "";
$prep_users = $this->dbh->prepare($sql_users);
if (!$prep_users) {
$msg = $this->dbh->errorInfo();
throw new HWIException(ERR0021 . " " . $msg[2], 21);
}

$prep_users->bindParam(':username', $this->userObj->hwi_username,
PDO::PARAM_STR, 16);
$prep_users->bindParam(':title', $this->userObj->hwi_title,
PDO::PARAM_STR, 4);
$prep_users->bindParam(':firstname', $this->userObj->hwi_firstname,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':midinit', $this->userObj->hwi_midinit,
PDO::PARAM_STR, 1);
$prep_users->bindParam(':lastname', $this->userObj->hwi_lastname,
PDO::PARAM_STR, 45);
$prep_users->bindParam(':priphone', $this->userObj->hwi_priphone,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':priext', $this->userObj->hwi_priext,
PDO::PARAM_STR, 10);
$prep_users->bindParam(':secphone', $this->userObj->hwi_secphone,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':secext', $this->userObj->hwi_secext,
PDO::PARAM_STR, 10);
$prep_users->bindParam(':fax', $this->userObj->hwi_fax,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':isPI', $this->userObj->hwi_ispi,
PDO::PARAM_INT);
$prep_users->bindParam(':date_returned', $outdc, PDO::PARAM_STR);
$prep_users->bindParam(':liid', $outliid, PDO::PARAM_STR);
##################### PROBLEM LINE OF CODE ###################
$exec = $prep_users->execute();
################################################## ###############

if(!$exec) {
$msg = $prep_users->errorInfo();
throw new HWIException(ERR0022 . " " . $msg[2], 22);
}

Jun 21 '07 #1
1 2543
On 21.06.2007 15:38 gp wrote:
************************************************** ************************************************** **************************
Catchable fatal error: Object of class stdClass could not be
converted to string in <filenameon line <line>
************************************************** ************************************************** **************************

I can only find the change log for PHP 5.2 identifying this type of
error, nothing on how to fix it. I have updated PHP to 5.2.3 on
Apache 2.2.x on a BSD Box 6.x If some one could explain to me what I
am doing wrong, and what I need to do to fix it that would be swell.
A point of note is that my $dbh is being created in my class
constructor as a private. The method that is calling the prepare and
execute statements is a public. I don't thing I'm trying to do
anything new or exotic, I don't think I'm trying to convert the object
to a string, just execute the query statement....
[snip]
Someone on this group has argued this (quite stupid) "improvement" in
php 5.2 should be good... a nice illustration.

Minimize your problem code and file a bug on php.net, there's nothing
more you can do about this.
--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Jun 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rocket Hawk | last post by:
Hello all, i need to run XXXX.BAT file from ASP page use windows 2000 server the XXXX.BAT file run as: used exist maped drive to shared folder on ServerB and copy files to ServerA On...
3
by: howachen | last post by:
Hi, When doing mysql query (SELECT statements) in php, we often use prepare statement to prevent SQL injection. However, I just noticed that the prepare statements can SLOW the number of queries...
5
by: loudwinston | last post by:
Hello, I'm encountering a strange error with PDO. The server is FreeBSD 4.4, PHP 5.1.2, mySQL 4.0.20 with 4.1.18 client libs. I have the following code (usernames and passwords changed to...
9
by: Ratfish | last post by:
I'm getting a "2014:: Commands out of sync; you can't run this command now" error on a php page when I try to call a second stored procedure against a MySQL db. Does anyone know why I might be...
1
by: spooky | last post by:
Hi, How do i return a value while using a prepare- execute(). when execute is executed the value is displayed but can i pass that selected value to a variable.
3
by: nghivo | last post by:
My environment DB2 9.1.4 on Sun OS I write a C embedded SQL to load data. I declare host vars as: EXEC SQL BEGIN DECLARE SECTION; SQL TYPE IS CLOB(599999) sqlStr; EXEC SQL END DECLARE...
2
by: jabernet | last post by:
In DB2 LUW 'till Version 9 it is not possible to execute dynamic SQL in a UDF (at least as I understand it; maybe I'm just doing something wrong). Is this planed to be included in Future Versions?...
1
by: Jeff | last post by:
asp.net 3.5 I've created a database in Sql Server 2005 for my asp.net project. I used aspnet_regsql to add membership tables and stored procedures. Then I added a login/user to this database....
1
by: m | last post by:
Maybe this has been asked and answered - but I have been looking through old archives for quite some time.... Typical Java app running from Websphere connected to DB2 V8.2FP15 on Linux using...
5
by: Gilles Ganault | last post by:
Hello I use the prepare/execute combo to generate SQL statements. Is it possible to actually see what PDO creates with prepare()? ======= $sql = "INSERT INTO mytable (id, label) VALUES...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.