Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
Forum.: | PortaL |:.GalleryLatest imagesKërkoRegjistrohuidentifikimi

 

 Data Source Name (DSN) Support

Shko poshtë 
2 posters
AutoriMesazh
Mr.VisarS
AdministratoR/DesigneR
AdministratoR/DesigneR
Mr.VisarS


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

Data Source Name (DSN) Support Empty
MesazhTitulli: Data Source Name (DSN) Support   Data Source Name (DSN) Support Icon_minitimeWed 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ë
http://www.loqka-chat.tk
Go0s3
Super/Moderator
Super/Moderator
Go0s3


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

Data Source Name (DSN) Support Empty
MesazhTitulli: Data Source Name (DSN) Support   Data Source Name (DSN) Support Icon_minitimeMon 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ë
 
Data Source Name (DSN) Support
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: