[DB-SIG] Simple db access

Piotr Trawinski piotr.trawinski@weblab.pl
Fri, 29 Jun 2001 16:55:03 +0200


I am pretty much new to python. At the moment i am trying to figure out
how to make a simple connection to a mysql db. The Python Database API
Specification doesnt make it clear for me. Could you please give me an
example or an equilvalent of this php code:

mysql_pconnect ($host,$user,$passwd);
mysql_select_db($name,);


$query=mysql_query("select * from test");

while ($data=mysql_fetch_row($query)) {
        echo $data[0];
        echo $data[1];
}

I will greatly appreciate any help
Piotr Trawinski