| View previous topic :: View next topic |
| Author |
Message |
tomas.teicher
Joined: 07 Nov 2009 Posts: 1
|
Posted: Sat Nov 07, 2009 9:56 pm Post subject: Database connection in function |
|
|
Hi,
I have a connection to database through Pear
$dbh = DB::connect( //connection data...
could I send $dbh object to function without declare as its parameter?
like:
| Code: |
my_function();
function my_function(){
$dbh->$query("SELECT * FROM table");
}
|
in mysql_query it works
Many thanks for advice
Tomas |
|
| Back to top |
|
 |
|
|
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
|
|