![]() |
retreiving information from the class
PHP Code:
Catchable fatal error: Object of class registo could not be converted to string in /home/vnhdpwxq/public_html/classes/classe_ler_registos.php on line 68 I believe it is because of the sentence: PHP Code:
What I really need is to make a $this->scr_name_customer. Can someone help me overpass this problem? I have completely run out of ideas. Thanks in advance, PP |
Quote:
PHP Code:
|
Hi VI,
From the main program I want to the following: $customer = new record(); $customer_name = $customer->scr_name_customer; $customer_email = $customer->scr_email_customer; $customer_phone = $customer->scr_tele_customer; $customer_fax = $customer->scr_fax_customer; $customer_vat = $customer->scr_vat_customer; On the record class I retrieve one variable called stringfieldname when I wanted to have all the different fields of the table on different variable names such as scr_name_customer, scr_email_customer, etc.... That's why I was using the $this->$stringfieldname =..., I had this variable inside a cycle varying, obtaining this way $this->scr_name_customer=..., $this->scr_email_customer=..., $this->scr_tele_customer=..., etc I also tried another way which was inside this cycle to have a variable called "fieldname" with the variable names (this->scr_name_customer, this->scr_email_customer, this->scr_tele_customer=... and then use: $$fieldname=.... But also did not work I hope this clears Your doubts VI, I really need some help here. I am starting to think that it will not be possible because I tried so many things. I have spent many hours here already. Thanks in advance, PP |
| All times are GMT. The time now is 06:44 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0