PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Why DB class put (&) before method name

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Sat Feb 17, 2007 9:25 pm    Post subject: Why DB class put (&) before method name Reply with quote

i am a new php programmer and i am trying to understand some php standard. I don't understand why did the DB class in PEAR put the & before some methods name.

another thing is it better for me to use DB class of MDB2 class in PEAR site there is some warning about using DB class
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Feb 18, 2007 12:29 am    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
i am a new php programmer and i am trying to understand some php standard. I don't understand why did the DB class in PEAR put the & before some methods name.


http://www.php.net/manual/en/language.references.pass.php

baselbj wrote:
another thing is it better for me to use DB class of MDB2 class in PEAR site there is some warning about using DB class


I don't see a question here. Wink

The answer is: MDB2 is the successor of DB. If you don't have a good reason for using DB (which does not seem to be the case), your choice should be MDB2. It is also faster than MDB2 in most cases.
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Sun Feb 18, 2007 12:05 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

mark wrote:
baselbj wrote:
i am a new php programmer and i am trying to understand some php standard. I don't understand why did the DB class in PEAR put the & before some methods name.


http://www.php.net/manual/en/language.references.pass.php

baselbj wrote:
another thing is it better for me to use DB class of MDB2 class in PEAR site there is some warning about using DB class


I don't see a question here. Wink

The answer is: MDB2 is the successor of DB. If you don't have a good reason for using DB (which does not seem to be the case), your choice should be MDB2. It is also faster than MDB2 in most cases.



but in PEAR site when you enter the DB class page there is a warning that DB class is not well tested so it is better to use MDB2.

any way i will use the DB class

thank you for your help mark Cool
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Feb 18, 2007 2:27 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
but in PEAR site when you enter the DB class page there is a warning that DB class is not well tested so it is better to use MDB2.


No, the warning tells you that DB was superseded by MDB2 and that you are encouraged to use MDB2. The DB package is still maintained, but only for bug fixes. New features will not be included in DB.

baselbj wrote:
any way i will use the DB class


??? Is this a typo and you meant MDB2? Your sentence contradicts both what you said and what I said.
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Sun Feb 18, 2007 7:28 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

mark wrote:
baselbj wrote:
but in PEAR site when you enter the DB class page there is a warning that DB class is not well tested so it is better to use MDB2.


No, the warning tells you that DB was superseded by MDB2 and that you are encouraged to use MDB2. The DB package is still maintained, but only for bug fixes. New features will not be included in DB.

baselbj wrote:
any way i will use the DB class


??? Is this a typo and you meant MDB2? Your sentence contradicts both what you said and what I said.


It wasn't a typo Embarassed I think I missed understand you at the first time. what I understand is that DB is the new class, but when goes back to your replay I understand that is wrong.

So I will use the MDB2 class in my work.

thank you mark Wink Wink
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Feb 18, 2007 8:33 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
It wasn't a typo Embarassed I think I missed understand you at the first time. what I understand is that DB is the new class, but when goes back to your replay I understand that is wrong.


Ah, now I see that I made a mistake:
"It is also faster than MDB2 in most cases."
It actually wanted to write that MDB2 is faster than DB in most cases.

Sorry for the confusion.
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Sun Feb 18, 2007 8:45 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

mark wrote:
baselbj wrote:
It wasn't a typo Embarassed I think I missed understand you at the first time. what I understand is that DB is the new class, but when goes back to your replay I understand that is wrong.


Ah, now I see that I made a mistake:
"It is also faster than MDB2 in most cases."
It actually wanted to write that MDB2 is faster than DB in most cases.

Sorry for the confusion.


it is ok mark.

can you help me in that Question

I am thinking of using DB_DataObject for my project i love oo programing. in DB_DataObject every thing is object.

unfortunately DB_DataObject mainly supports the DB class and did not work perfectly with MDB2.

So is it good idea to use DB_DataObject or not ?

i am sorry mark i know i ask so much and my English is not perfect Embarassed
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Feb 18, 2007 8:58 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
can you help me in that Question

I am thinking of using DB_DataObject for my project i love oo programing. in DB_DataObject every thing is object.

unfortunately DB_DataObject mainly supports the DB class and did not work perfectly with MDB2.

So is it good idea to use DB_DataObject or not ?


<advertisement>DB_Table has a similar approach as DB_DataObject</advertisement> Wink

I have no experience with DB_DO, but I know that it supports both DB and MDB2. And I know some people that use the combination of DB_DO with MDB2. Is "did not work perfectly" your own experience or did you read this somewhere?

baselbj wrote:
i am sorry mark i know i ask so much and my English is not perfect Embarassed


If your nickname indicates a city in Switzerland and your native language is German (which is also my native language), a better place for your questions might be pear-forum.de (some of the helpers there have very much DB_DO experience).
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Sun Feb 18, 2007 9:15 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

mark wrote:
baselbj wrote:
can you help me in that Question

I am thinking of using DB_DataObject for my project i love oo programing. in DB_DataObject every thing is object.

unfortunately DB_DataObject mainly supports the DB class and did not work perfectly with MDB2.

So is it good idea to use DB_DataObject or not ?


<advertisement>DB_Table has a similar approach as DB_DataObject</advertisement> Wink

I have no experience with DB_DO, but I know that it supports both DB and MDB2. And I know some people that use the combination of DB_DO with MDB2. Is "did not work perfectly" your own experience or did you read this somewhere?

baselbj wrote:
i am sorry mark i know i ask so much and my English is not perfect Embarassed


If your nickname indicates a city in Switzerland and your native language is German (which is also my native language), a better place for your questions might be pear-forum.de (some of the helpers there have very much DB_DO experience).


No I am not from Switzerland I am from Jordan small country in the Mideast I don't know if you know it ?

now about your Adz do you mean that DB_Table is better or more tested. Or you just want me to now that there is another option for me?

about why I think that DB_DO "did not work perfectly" , this can be found in the DB_DO example.ini file :

;db_driver = DB
; can be set to MDB or DB
; uses MDB backend rather than PEAR DB
; generator will probably not work!
; (EXPERIMENTAL)
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sun Feb 18, 2007 9:35 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
No I am not from Switzerland I am from Jordan small country in the Mideast I don't know if you know it ?


No, not really. But it could have been possible that your nickname indicated that you are living in Basel.

baselbj wrote:
now about your Adz do you mean that DB_Table is better or more tested. Or you just want me to now that there is another option for me?


Yes, only a pointer to an alternative (surrounded by the ad tag because I maintain DB_Table currently). Both packages have a very similar goal, while DB_DO is going more in the OO direction.

baselbj wrote:
about why I think that DB_DO "did not work perfectly" , this can be found in the DB_DO example.ini file :

;db_driver = DB
; can be set to MDB or DB
; uses MDB backend rather than PEAR DB
; generator will probably not work!
; (EXPERIMENTAL)


Okay, the generator is only one part of DB_DO and maybe the comment wasn't removed although MDB2 isn't experimental anymore. And I really think that DB_DO is ready to be used with MDB2, otherwise people wouldn't use the combination already.
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Mon Feb 19, 2007 9:50 am    Post subject: Re: Why DB class put (&) before method name Reply with quote

Quote:

No, not really. But it could have been possible that your nickname indicated that you are living in Basel.


No it is my name. Jordan is a small country near Iraq I think you have to know both Iraq and Jordan because of the war.

Quote:
Yes, only a pointer to an alternative (surrounded by the ad tag because I maintain DB_Table currently). Both packages have a very similar goal, while DB_DO is going more in the OO direction.


it is great to know one of PEAR developer I really loved the PEAR methodology. I think DB_DO is better for me as I Said before OO is great.

Quote:
Okay, the generator is only one part of DB_DO and maybe the comment wasn't removed although MDB2 isn't experimental anymore. And I really think that DB_DO is ready to be used with MDB2, otherwise people wouldn't use the combination already.


Yesterday I tested DB_DO with MDB2 and it worked perfectly.

what I want know is a good and full documentation about the DB_DO, because the one on the site did not Expound how to use DB_DO with multi DB.

And Mark, can you give your email Rolling Eyes

Thank You Very much Mark Very Happy Very Happy
Back to top
View user's profile Send private message
baselbj



Joined: 17 Feb 2007
Posts: 7

PostPosted: Mon Feb 19, 2007 9:52 am    Post subject: Re: Why DB class put (&) before method name Reply with quote

Quote:

No, not really. But it could have been possible that your nickname indicated that you are living in Basel.


No it is my name. Jordan is a small country near Iraq I think you have to know both Iraq and Jordan because of the war.

Quote:
Yes, only a pointer to an alternative (surrounded by the ad tag because I maintain DB_Table currently). Both packages have a very similar goal, while DB_DO is going more in the OO direction.


it is great to know one of PEAR developer I really loved the PEAR methodology. I think DB_DO is better for me as I Said before OO is great.

Quote:
Okay, the generator is only one part of DB_DO and maybe the comment wasn't removed although MDB2 isn't experimental anymore. And I really think that DB_DO is ready to be used with MDB2, otherwise people wouldn't use the combination already.


Yesterday I tested DB_DO with MDB2 and it worked perfectly.

what I want know is a good and full documentation about the DB_DO, because the one on the site did not Expound how to use DB_DO with multi DB.

And Mark, can you give your email Rolling Eyes

Thank You Very much Mark Very Happy Very Happy
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Mon Feb 19, 2007 1:59 pm    Post subject: Re: Why DB class put (&) before method name Reply with quote

baselbj wrote:
Jordan is a small country near Iraq I think you have to know both Iraq and Jordan because of the war.


Ah, I was thinking of a city with that name. Wink Of course, I know the country (but wasn't aware of the English name of it).

baselbj wrote:
what I want know is a good and full documentation about the DB_DO, because the one on the site did not Expound how to use DB_DO with multi DB.


I don't know one, but Google might help you maybe.

baselbj wrote:
And Mark, can you give your email Rolling Eyes


Just click on the "www" button below my post and then on "Imprint". You will find my email address there and also a contact form.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software