Passer l'objet connection d'une page à une autre
Bonjour,
J'aimerais savoir si c'est possible de passer l'objet connection d'une page à une autre..
par ex :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
if($_POST["radiobutton"] == "3")
{
$nomBD = $_POST["databasename"];
print('<CAPTION style=\'color:pink;\'>Managing the database : " ' . $nomBD . "\"</CAPTION>
<tr id=\'titCol\'>
<td> <input type=radio name=\"choix1\" value=\"0\"/ onClick=\"cacher()\">A whole table </td>
<td> <input type=radio name=\"choix1\" value=\"1\"/>A stored procedure </td>
<td> <input type=radio name=\"choix1\" value=\"2\"/>Your own SQL sentences </td>
</tr>");
$db=ADONewConnection('odbc_mssql');
$db->debug=1;
$dsn = "Driver={SQL Server};Server=" . $_POST['txtIP'] . ";Database={" . $nomBD . "};";
$db->Connect($dsn,$_POST['User'],$_POST['pwd']) || die('fail-MSSQLserver'); |
Dans ce cas ci l'objet db ..
Ou alors dois-je recréer la connection sur chaque page?
Celà me semble assez lourd... même si ça serait vite fais avec un "include"..
J'attends vos réactions avec impatience !
Merci.