so first i have the base script:
Code: Select all
<?php
include("functions/foo.php");
print_html_header();
fubar($table);
print_html_footer();
?>Code: Select all
// inside foo.php
...
function fubar($table)
{
$connection_A = mysql_connect(...);
//some code...
another_function_call();
mysql_close($connection_A);
}
...Code: Select all
// further down in foo.php
...
function another_function_call()
{
$connection_B = mysql_connect(...same database);
//do stuff
mysql_close($connection_B);
}
...i personally don't see anything wrong with it. but then again, if ive already initialised a sql connection, should i try use the same one? or is there no danger in my current approach?