Forumi­.: | PortaL |:.­Gallery­Pytësori­Kërko­Lista e Anëtarëve­Grupet e Anëtarëve­Regjistrohu­Identifikohu
Posto temë të re   Përgjigju temësShare | 
 

 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: 16
Vendi: kosovë
Registration date: 26/09/2008

MesazhTitulli: Data Source Name (DSN) Support   Tue Oct 21, 2008 11:26 pm

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: 17
Vendi: En Pc
Registration date: 26/09/2008

MesazhTitulli: Data Source Name (DSN) Support   Mon Dec 15, 2008 10: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
 :: Loqka Chat Hack :: Tutorials/Mesime-
Posto temë të re   Përgjigju temës