473,698 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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->beginTransacti on();
if (!$begin) throw new HWIException(ER R0023,23);

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

$prep_users->bindParam(':us ername', $this->userObj->hwi_username ,
PDO::PARAM_STR, 16);
$prep_users->bindParam(':ti tle', $this->userObj->hwi_title,
PDO::PARAM_STR, 4);
$prep_users->bindParam(':fi rstname', $this->userObj->hwi_firstnam e,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':mi dinit', $this->userObj->hwi_midinit,
PDO::PARAM_STR, 1);
$prep_users->bindParam(':la stname', $this->userObj->hwi_lastname ,
PDO::PARAM_STR, 45);
$prep_users->bindParam(':pr iphone', $this->userObj->hwi_priphone ,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':pr iext', $this->userObj->hwi_priext,
PDO::PARAM_STR, 10);
$prep_users->bindParam(':se cphone', $this->userObj->hwi_secphone ,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':se cext', $this->userObj->hwi_secext,
PDO::PARAM_STR, 10);
$prep_users->bindParam(':fa x', $this->userObj->hwi_fax,
PDO::PARAM_STR, 30);
$prep_users->bindParam(':is PI', $this->userObj->hwi_ispi,
PDO::PARAM_INT) ;
$prep_users->bindParam(':da te_returned', $outdc, PDO::PARAM_STR) ;
$prep_users->bindParam(':li id', $outliid, PDO::PARAM_STR) ;
############### ###### PROBLEM LINE OF CODE ############### ####
$exec = $prep_users->execute();
############### ############### ############### ############### #####

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

Jun 21 '07 #1
1 2554
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) "improvemen t" 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
1690
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 ServerA in the IIS site i set domain account for Anonymous Access Authentication
3
2862
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 per second by a factor of 2 times (max). So are there any faster method that can prevent SQL injection, but has a better performance?
5
16500
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 protected the innocent ^_^) <? $db_dsn = "mysql:host=dbHost;dbname=dbName";
9
2947
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 getting this error? The error doesn't occur on my development box where I use the 'root' db user, but does occur in production where I'm using a non- root user record to establish a connection. I'm essentially opening a connection at the top of...
1
1142
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
7006
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 SECTION;
2
2324
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? Somebody has an Idea for a workaround to this? What I need to do: We have for different customers an individual customer table, and we'd like a table UDF to return the records of a customer table based on the ID of a customer. This would allow...
1
3693
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. Default schema for this user is dbo. When I try to execute my asp.net webpage I get this error: EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database
1
2893
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 JDBC Type 4 drivers. Programmers use mostly PREPARE/EXECUTE logic for security and 'other' reasons - but some SQL executes MUCH slower than same SQL using plain old SQL with values then the SQL with variable markers. Worst case 20 seconds vs. 1...
5
2013
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 (NULL,?)"; $insert = $dbh->prepare($sql); //Display SQL before running it
0
8600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2323
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.