Python Forum
Storing MySQL BIT Data Type data in python variable
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Storing MySQL BIT Data Type data in python variable
#3
I have to store the 2nd value and then add a condition e.g.

if 2nd_value == 'None':
   online_status='offline'
elif 2nd_value == 0 :
   online_status='Offline'
elif 2nd_value == 1
   online_status='Online'
Here the issue is the query is failing with below code when the value is None .

2nd_value=(ord(records[0][1]))
Let me know if any better approach to get my task done .
Reply


Messages In This Thread
RE: Storing MySQL BIT Data Type data in python variable - by krushna - Dec-31-2018, 01:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 336 Apr-18-2024, 09:55 PM
Last Post: deanhystad
  Help with to check an Input list data with a data read from an external source sacharyya 3 448 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  need help with data analysing with python and sqlite Hardcool 2 392 Jan-30-2024, 06:49 AM
Last Post: Athi
  Better python library to create ER Diagram by using pandas data frames as tables klllmmm 0 1,191 Oct-19-2023, 01:01 PM
Last Post: klllmmm
  Mysql and mysql.connector error lostintime 2 721 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Bulk loading of data using python shivamsvmsri 2 728 Sep-28-2023, 09:04 AM
Last Post: shivamsvmsri
  Python loop for posting data to web marciokoko 10 1,586 Aug-26-2023, 02:17 AM
Last Post: deanhystad
  How to detect abnormal data in big database python vanphuht91 5 1,169 Jun-27-2023, 11:22 PM
Last Post: Skaperen
Video doing data treatment on a file import-parsing a variable EmBeck87 15 2,982 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  Python 3.11 data import question love0715 2 825 Mar-05-2023, 06:50 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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