Programming Languages: Zope, Python, C
License: Python License (CNRI Python License), Zope Public License, GNU General Public License version 2.0 (GPLv2)
browse code,
statistics svn co https://mysql-python.svn.sourceforge.net/svnroot/mysql-python mysql-python
browse code,
statistics http://mysql-python.hg.sourceforge.net:8000/hgroot/mysql-python/mysql-python (read-only)
This is getting out of the scope of using MySQLdb. I would suggest you to learn SQL first.
2012-04-30 14:45:46 PDT by huuda
would you know an SQL statement to search a whole database? il create a simple search box in html and then connect it to a cgi with an sql statement to search all of my database in phpadmin depending on what the user is looking for. if the user types in house1 and clicks search they will get a return on all info with house1 from the database??.
2012-04-30 14:33:10 PDT by ireland200
Ok, in my test, after I execute a query it is set. But in my django app I am doing this: from django.db import connection cursor = connection.cursor() cursor.execute(sql) and it's getting the no attribute error. So I guess this means that the sql isn't getting executed for some reason. I'll have to investigate that avenue.
2012-04-30 14:25:59 PDT by https://www.google.com/accounts
Well... you haven't executed a query, now have you? Arguably though it should be initialized to None.
2012-04-30 14:11:52 PDT by adustman
I am working on a django app, and it's blowing up in this in django/db/backends/mysql/base.py: def last_executed_query(self, cursor, sql, params): # With MySQLdb, cursor objects have an (undocumented) "_last_executed" # attribute where the exact query sent to the database is saved. # See MySQLdb/cursors.py in the source distribution. return...
2012-04-30 14:03:08 PDT by https://www.google.com/accounts
thats great thanks you !!
2012-04-30 10:27:00 PDT by ireland200
You would need to extract both values from your form, something like: [code]house = form['House'].value colour = form['Colour'].value[/code] and they call with something like: [code]cursor.execute('''SELECT * FROM `HOMES` WHERE your_column1 = %s AND your_column2 = %s''', (house, colour))[/code] Perhaps, have a look at the API...
2012-04-30 10:16:51 PDT by huuda
hi thanks for your help - it turns out that the problem was with the phpadmin database...thanks again. however I do have another question. On my html I have multiple drop down menus. the user must choose the two options from two drop down menus and then click on 'submit'. so lets say the html is : choice 1: houseA>houseB>houseC(this is the list) choice 2: Red>Blue>green...
2012-04-30 08:04:19 PDT by ireland200
Since MySQLdb uses paramstyle 'format', literal "%" has to be escaped as "%%". However, if you do a query without parameters using cursor.execute(sql), "%%" remains literal "%%". Workaround is to use cursor.execute(sql,())
2012-04-27 09:06:17 PDT by Vartec
Not sure if I inderstood right, but there's some info missing here. Isn't it just basic SQL? [code]cursor.execute('''SELECT * FROM `HOMES` WHERE your_column = %s''', my_usr_mutation)[/code].
2012-04-27 06:16:00 PDT by huuda