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 
mdb2 classes extended.php

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



Joined: 25 Sep 2007
Posts: 12

PostPosted: Wed Sep 03, 2008 9:42 am    Post subject: mdb2 classes extended.php Reply with quote

Hello

I am makin a log function for a database with php.

I am using MDB2 autoExecute etc.

Now I wonder, how, and is it possible, without changing any in the Extended.php class, to reach and use the variables inside the class MDB2_Extended extends MDB2_Module_Common??

I need the variable $params in the function autoExecute.

Please I need som help, ist urgent:)
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Wed Sep 03, 2008 9:59 am    Post subject: Reply with quote

Isn't the second parameter of this method ($field_values) what you need?
http://pear.php.net/manual/en/package.database.mdb2.intro-auto.php

If it isn't, please rephrase your problem. I have no idea what you're trying to do.
Back to top
View user's profile Send private message
Pearus



Joined: 25 Sep 2007
Posts: 12

PostPosted: Wed Sep 03, 2008 10:18 am    Post subject: Reply with quote

Hello,its fantasctic if you can help I try to be more spesific:

I have my own class test.class.php where I have a function general_insert:

function general_insert($table_name,$fields_values,$types){
global $db;
$db->beginTransaction();
$affectedrows = $db->extended->autoExecute($table_name,$fields_values,MDB2_AUTOQUERY_INSERT,null,$types);
if (PEAR::isError($affectedrows)){
return $affectedrows->getMessage();
} else {
return true;
}
}


so my question is - I know how to call a function from the Extended.php but is it any way to get the values from different variables inside the functions in Extended.php eks:

in the function autoExecute() there is a statement:

$params = array_values($fields_values);

I would like to use $params in my class - how do I get to the value of this variabel.

when I tried: $get_var=$db->extended->$params i just get the error empty propierty.

Can you help???


Last edited by Pearus on Wed Sep 03, 2008 10:21 am; edited 1 time in total
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Wed Sep 03, 2008 10:21 am    Post subject: Reply with quote

Okay, the usage of autoExecute() looks fine. But what are you trying to do? What doesn't work?
Back to top
View user's profile Send private message
Pearus



Joined: 25 Sep 2007
Posts: 12

PostPosted: Wed Sep 03, 2008 11:08 am    Post subject: Reply with quote

Shall I explaine further - I hope so that you can give me a hint:)
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Wed Sep 03, 2008 11:15 am    Post subject: Reply with quote

Pearus wrote:
Shall I explaine further - I hope so that you can give me a hint:)


Well, yes, that's what I was asking since two postings ...
Back to top
View user's profile Send private message
Pearus



Joined: 25 Sep 2007
Posts: 12

PostPosted: Wed Sep 03, 2008 11:50 am    Post subject: Reply with quote

Sorry, didnt you si the post where I have explained it better - I am not sure if I can explanied more - I want to be able to get values from a variable inside the class in Extended.php

Smile
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Wed Sep 03, 2008 1:04 pm    Post subject: Reply with quote

Again, why do you want to do that? What is the motivation behind your idea? You shouldn't need internal MDB2 data in your own scripts.
Back to top
View user's profile Send private message
Pearus



Joined: 25 Sep 2007
Posts: 12

PostPosted: Wed Sep 03, 2008 2:02 pm    Post subject: Reply with quote

I want to make a log file for the query and entries in the database
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Wed Sep 03, 2008 4:26 pm    Post subject: Reply with quote

Pearus wrote:
I want to make a log file for the query and entries in the database


You don't make it easy to help you.

Why do you think that you need an internal value from MDB2? What is this value?

Are you aware that e.g. MySQL offers query logging itself?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR 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