Forum.: | PortaL |:.GalleryPytësoriKërkoLista AnëtarëveGrupet e AnëtarëveRegjistrohuidentifikimi

Share | 
 

 Data Source Name (DSN) Support

Shiko temën e mëparshme Shiko temën pasuese Shko poshtë 
AutoriMesazh
Mr.VisarS
AdministratoR/DesigneR
AdministratoR/DesigneR


Numri i postimeve : 526
Age : 23
Vendi : kosovë
Registration date : 26/09/2008

MesazhTitulli: Data Source Name (DSN) Support   Wed Oct 22, 2008 12:26 am

Data Source Name (DSN) Support


Since ADOdb 4.51, you can connect to a database by passing a dsn to NewADOConnection (or ADONewConnection, which is
the same function). The dsn format is:
$driver://$username:$password@hostname/$database?options[=value]
NewADOConnection() calls Connect() or PConnect() internally for you. If the connection fails, false is returned.
# non-persistent connection
$dsn = 'mysql://root:pwd@localhost/mydb';
$db = NewADOConnection($dsn);
if (!$db) die("Connection failed");

# no need to call connect/pconnect!
$arr = $db->GetArray("select * from table");

# persistent connection
$dsn2 = 'mysql://root:pwd@localhost/mydb?persist';

If you have special characters such as /:? in your dsn, then you need to rawurlencode them first:
$pwd = rawurlencode($pwd);
$dsn = "mysql://root:$pwd@localhost/mydb";
$dsn2 = rawurlencode("sybase_ase")."://user:pass@host/path?query";
Mbrapsht në krye Shko poshtë
Shiko profilin e anëtarit http://www.loqka-chat.tk
Go0s3
Super/Moderator
Super/Moderator


Numri i postimeve : 64
Age : 24
Vendi : En Pc
Registration date : 26/09/2008

MesazhTitulli: Data Source Name (DSN) Support   Mon Dec 15, 2008 11:48 pm

ku je bro qau bon a je nice shum posTe t'qarTa veq ----> (ask-ja e qarT a :$)
Mbrapsht në krye Shko poshtë
Shiko profilin e anëtarit
 
Data Source Name (DSN) Support
Shiko temën e mëparshme Shiko temën pasuese Mbrapsht në krye 
Faqja 1 e 1

Drejtat e ktij Forumit:Ju nuk mund ti përgjigjeni temave të këtij forumi
 :: PC & Console :: Tutorials/Mesime-
Kërce tek: