On Wed, 22 Jun 2005 15:06:22 -0400
Python <[EMAIL PROTECTED]> wrote:
> On Wed, 2005-06-22 at 14:20 -0400, Don Parris wrote:
> > On Tue, 21 Jun 2005 19:13:43 -0400
> > Python <[EMAIL PROTECTED]> wrote:
> >
> >
Here's my solution, using the code Lloyd provided in a previous post:
The script that
On Tue, 21 Jun 2005 19:13:43 -0400
Python <[EMAIL PROTECTED]> wrote:
Alright, I've had time to play with this and wanted to be sure I understand
this well. It works, so I understand enough to make it work. However, I
see a difference between your code and mine that makes me think I've missed
so
On Tue, 21 Jun 2005 19:13:43 -0400
Python <[EMAIL PROTECTED]> wrote:
> I like to use the following style of code. Since there will be
> passwords, the connection strings should be somewhat protected. Put
> them in a separate file that can be controlled. Here's my sample code.
> >>
As a newbie developer, the easiest way for me to connect to MySQL is to
> just copy & paste the connection commands into each funtion I write.
> However, I know that's far from ideal, and consumes more time than its
> worth. I would like to create a MySQL connection function that I can just
> cal
> worth. I would like to create a MySQL connection function that I
can just
> call up whenever I need it from within an other function.
Good idea!
> ### The Connection Definition ###
> # def mysql_Conn():
> # Create a connection object and create a cursor.
> # Con = MySQLdb.Connect(host=
This a very simple connection using mysql.
1. connect to mysql:
db = mySQLdb.connect(user='root',passwd='something')
2. To execute and get the result:
c = db.cursor()
c.execute(sql comment)
result = c.fetchall()
you can wrap it in a class object.
pujo
On 6/21/05, Don Parris <[EMAIL PROTECTED]>
As a newbie developer, the easiest way for me to connect to MySQL is to
just copy & paste the connection commands into each funtion I write.
However, I know that's far from ideal, and consumes more time than its
worth. I would like to create a MySQL connection function that I can just
call up whe