Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

# var is a value for ex temperature of sensor  # FOR EXAMPLE  var =  oldvar  = '29' if var != oldvar              do..... elseif i write this: 1. first temperature detected is 29 2. assig to oldvar...
tarata General Coding Help 18 13,531 Dec-24-2016, 12:25 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

# var is a value for ex temperature of sensor  # FOR EXAMPLE  var = '29' if var != oldvar oldvar = var do..... elseThe problem is when first loop of cycle start: if the first temperature is x.... How...
tarata General Coding Help 18 13,531 Dec-23-2016, 02:38 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

(Dec-20-2016, 04:35 PM)Larz60+ Wrote: Build the test before inserting into the SQL statement like: qvar = '%{}%'.format(var) sql = "select valore from tab where valore LIKE qvar" sorry for my bad en...
tarata General Coding Help 18 13,531 Dec-21-2016, 07:33 AM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

WINNNNNN WORK ...... sql = """select valore from tab where valore LIKE '%s' """ % ("%" +var+ "%") print (%cursor.fetchone()) now i have other problem... my cycle (have  to do cycle one time even i...
tarata General Coding Help 18 13,531 Dec-20-2016, 03:48 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

If i use no a variable but a value import time import MySQLdb var = 'AAAA'   db = MySQLdb.connect(host="localhost", user="root", passwd="", db="db")     cursor = db.cursor()       sql = "select valor...
tarata General Coding Help 18 13,531 Dec-20-2016, 08:19 AM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

(Dec-19-2016, 11:16 PM)Larz60+ Wrote: That syntax looks correct to me. what is your error? AAA value is in the tab of db
tarata General Coding Help 18 13,531 Dec-19-2016, 11:17 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

import time import MySQLdb var = 'AAAA' db = MySQLdb.connect(host="localhost", user="root", passwd="", db="db") cursor = db.cursor() sql = "select valore from tab where valore LIKE '%$var%' " n...
tarata General Coding Help 18 13,531 Dec-19-2016, 11:06 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

GREAT... I HAVE A PROBLEM i must select... like variable.... so SELECT valore from table WHERE valore LIKE ('%variable%'); ...not work
tarata General Coding Help 18 13,531 Dec-19-2016, 10:13 PM
    Thread: help, search in python mysql
Post: RE: help, search in python mysql

(Dec-15-2016, 10:53 PM)Larz60+ Wrote: What error do you get? what is the actual code that you are using? The indentation on the snippet you show is wrng, and would give an error. What is the exact...
tarata General Coding Help 18 13,531 Dec-19-2016, 08:54 PM
    Thread: help, search in python mysql
Post: help, search in python mysql

hi i have a raspberry pi3. I install php mysql et... Now i want search if value is present in table. helpppp! my code is import time import MySQLdb val = 'BBBBB' db = MySQLdb.connect(host="local...
tarata General Coding Help 18 13,531 Dec-15-2016, 03:43 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020