473,544 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object of class stdClass could not be converted to string

ebcovert3
4 New Member
Ok, I really need help. I am running EE (an older version admittedly) but this just started happening. I noticed a lot of spam accounts being requesting authorization to my website. I went in to the account management section of my website and I am presented with this:

Expand|Select|Wrap|Line Numbers
  1. Catchable fatal error: Object of class stdClass could not be converted to string in /home/ninjamon/public_html/guitars/pm/cp/members.cp.php on line 62
Expand|Select|Wrap|Line Numbers
  1. Here is my members.cp.php file with line 62 marked.
  2. <?php
  3. //
  4. // pMachine Publishing Software
  5. //
  6. // Version 2.3
  7. //
  8. // Copyright (c) 2003 Rick Ellis  All rights reserved.
  9. //
  10. // THIS IS COPYRIGHTED SOFTWARE
  11. //
  12. // License holders may alter or modify this software for their own use, 
  13. // but may NOT resell or redistribute the modified or derivative version 
  14. // without prior written consent from pMachine.  Components from this 
  15. // software may not be extracted and used in other programs without prior 
  16. // written consent from pMachine.
  17. //
  18. // PLEASE READ THE LICENSE AGREEMENT
  19. //
  20.  
  21. //    ----------------------------------------------
  22. //      GET MEMBER PROFILE
  23. //    ----------------------------------------------
  24.  
  25. function get_member_profile($id, $show) 
  26. {    
  27.     global $use_session_id, $db_members, $L_CALENDAR, $db_mailinglist;
  28.     global $db_session, $member_code, $sx;
  29.  
  30.     $db = new DB();
  31.  
  32.     $qval = "id";
  33.  
  34.     if ($show == "new")
  35.         $qval = "member_id";
  36.  
  37.     if ($id == "self")
  38.     {
  39.         if ($use_session_id == 1) 
  40.         {
  41.             $sql = "select member_id from $db_session where session_id = '$sx'"; 
  42.             $query = new DB_query($db, $sql);                                                      
  43.             $query->db_fetch_object();
  44.             $member_code = $query->obj->member_id;
  45.  
  46.             unset($sql);
  47.             unset($query);
  48.         }
  49.  
  50.         $id = $member_code;
  51.         $qval = "member_id";
  52.     }
  53.  
  54.     $sql = "select * from $db_members where $qval = '$id'";    
  55.     $query = new DB_query($db, $sql);                                                      
  56.     $query->db_fetch_object();
  57.  
  58.     $query->obj->lastpost <> 0 ? $lastpost = date("m/d/Y m:i a",$query->obj->lastpost) : $lastpost = "-"; 
  59.  
  60.     $joindate = date("m/d/Y m:i a",$query->obj->joindate);
  61.  
  62.  
  63.     $q = "select count(*) as count from $db_mailinglist where email='$query->obj->email'"; <-- LINE 62
  64.     $res = new DB_query($db, $q);
  65.     $res->db_fetch_object();
  66.  
  67.     $res->obj->count > 0 ? $mailinglist ="yes" : $mailinglist ="";
  68.  
  69.     unset($q);
  70.     unset($res)
Any help would be greatly appreciated. I am not a coder or php guru. I am mostly the opposite of that.

TIA,
Ed
Apr 17 '09 #1
9 37161
Dormilich
8,658 Recognized Expert Moderator Expert
try var_dump() on $query and $query->obj, maybe it gives some hints.
Apr 17 '09 #2
ebcovert3
4 New Member
Ok, I don't really know to do that. I running everything from the GUI.
Apr 30 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
e.g. paste following code into line 61:
Expand|Select|Wrap|Line Numbers
  1. var_dump( $query );
  2. var_dump( $query->obj );
this will give you some text output (namely the object's properties).
Apr 30 '09 #4
ebcovert3
4 New Member
Wow. Thank you. That got me this:
Expand|Select|Wrap|Line Numbers
  1. object(DB_query)#3 (9) { ["query"]=>  resource(61) of type (mysql result) ["sql"]=>  string(40) "select * from pm_members where id = '80'" ["row"]=>  array(0) { } ["obj"]=>  object(stdClass)#2 (27) { ["id"]=>  string(2) "80" ["member_id"]=>  string(23) "20888449254861dcdad253d" ["username"]=>  string(9) "abu***" ["password"]=>  string(32) "[removed]" ["signature"]=>  string(9) "abu***" ["email"]=>  string(17) "***@krim.ws" ["location"]=>  string(0) "" ["url"]=>  string(0) "" ["occupation"]=>  string(0) "" ["interests"]=>  string(0) "" ["bio"]=>  string(0) "" ["bday_day"]=>  string(0) "" ["bday_month"]=>  string(0) "" ["bday_year"]=>  string(0) "" ["icq"]=>  string(0) "" ["aol_im"]=>  string(0) "" ["yahoo_im"]=>  string(0) "" ["msn_im"]=>  string(0) "" ["show_email"]=>  string(2) "no" ["get_email"]=>  string(2) "no" ["joindate"]=>  string(10) "1214373082" ["numentries"]=>  string(1) "0" ["numcomments"]=>  string(1) "0" ["lastpost"]=>  string(1) "0" ["status"]=>  string(1) "2" ["ipaddress"]=>  string(14) "77.127.106.213" ["deft_weblog"]=>  string(0) "" } ["res"]=>  NULL ["numrows"]=>  NULL ["rows"]=>  int(0) ["errors"]=>  int(0) ["result"]=>  bool(true) } object(stdClass)#2 (27) { ["id"]=>  string(2) "80" ["member_id"]=>  string(23) "20888449254861dcdad253d" ["username"]=>  string(9) "abubmiday" ["password"]=>  string(32) "350d20ac2e95dc31d573a3f34a1e3d22" ["signature"]=>  string(9) "abubmiday" ["email"]=>  string(17) "stotlytof@krim.ws" ["location"]=>  string(0) "" ["url"]=>  string(0) "" ["occupation"]=>  string(0) "" ["interests"]=>  string(0) "" ["bio"]=>  string(0) "" ["bday_day"]=>  string(0) "" ["bday_month"]=>  string(0) "" ["bday_year"]=>  string(0) "" ["icq"]=>  string(0) "" ["aol_im"]=>  string(0) "" ["yahoo_im"]=>  string(0) "" ["msn_im"]=>  string(0) "" ["show_email"]=>  string(2) "no" ["get_email"]=>  string(2) "no" ["joindate"]=>  string(10) "1214373082" ["numentries"]=>  string(1) "0" ["numcomments"]=>  string(1) "0" ["lastpost"]=>  string(1) "0" ["status"]=>  string(1) "2" ["ipaddress"]=>  string(14) "77.127.106.213" ["deft_weblog"]=>  string(0) "" }
  2. Catchable fatal error: 
Object of class stdClass could not be converted to string in /home/ninjamon/public_html/guitars/pm/cp/members.cp.php on line 63

Can you help me decipher it? I am not a db person at all.

TIA
Apr 30 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
where can I find the definition of the DB class? (the class used on line 30)

basicly I need to figure out whether $query->obj->email is a public, protected or private property, maybe I can find out something by looking at the db_fetch_obj() method.
Apr 30 '09 #6
ebcovert3
4 New Member
I am not sure. Sorry. But I am willing to send you any file you think would help. I know I am not much of a help here. LOL. Sorry.
Apr 30 '09 #7
Dormilich
8,658 Recognized Expert Moderator Expert
I'll first try my luck with the definition of DB. you can recognise it by the following line

Expand|Select|Wrap|Line Numbers
  1. class DB
  2. // or 
  3. class DB extends {parent-class-name}
  4. // or
  5. class DB implements {one ore more interface names}
May 1 '09 #8
NatK
1 New Member
Thanks Dormilich!
You made me sign-up for this forum. :)
Nov 27 '09 #9
Dormilich
8,658 Recognized Expert Moderator Expert
unfortunately such interesting topics like OOP are rather rare (;_;)
Nov 27 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
18792
by: Amy L. | last post by:
I have a class that contains a string array. However, I can't get this object to serialize in the xml output. Is there a trick to get a string to serialize? Thanks Amy.
4
1690
by: Earl Teigrob | last post by:
In the exampe below, the constructor of the container class is passed the string called "foo". Within the container class, I would like to create an instance(s) of foo and add them to the ArrayList that is returned. (Once I figure this out I will use reflection on the instance to do other stuff) Anyway, How to I dyanamically create a new...
5
7441
by: Ram | last post by:
Hi Friends I want to develope a custom control in .net which can be used with any project. I am writing a function in that class which I want to take any object as parameter. For that I have used Object class as parameter. Now it can take any object as its parameter. But the problem is that I want to access the values of the private or...
4
3866
by: John Smith | last post by:
How can I allow someone to cast my C# class into System.String? Is it possible in C#? In C++ I used "operator" keyword to mark C++ member function.
5
1556
by: mikie | last post by:
somebody asked me a question: string is derived from object class, right? (i said yes) so how it could be object class declares method returning string? thanks for any explanation / link / whatever :) mikie
5
1926
by: TazaTek | last post by:
Hello, I've seen some vague references on how to do this a factory, but not in enough detail to create one, or even know if it's what I need. Essentially, I'll have one of about 5 classes that could be referenced as a string (from a file). I'm not 100% sure of the relationship between the classes, but I suspect that they will not be...
2
6475
by: Bigi | last post by:
Hi, Please help, this has been driving me nuts for nearly 2 days now. This vb6 code works: Public oEng As New ebizEngine Public oMsg As ebizMessage Function EbizGetFromQueue() As String
2
10830
by: Jean Marie | last post by:
Hi, i have a problem with the usage of stdClass. From a SOAP based web service i get a code list as an array of stdClass instances: array ( 0 => stdClass::__set_state(array(
2
2589
by: maheswaran | last post by:
Hi guys, I have below values in array stdClass Object ( => stdClass Object ( => 50s / 60s ERA => 87 => - => 25 => CONCERTS => 2 ) => Tony Bennett => 1073 => 0 ) When am calling Desciption object by $resultsObj->Description then i got the result " Tony Bennett" but i do not know to get the value GrandchildCategoryID . Just i...
0
7420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7362
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...
0
7602
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7764
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7368
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...
0
7704
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...
0
4911
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...
0
3404
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.