Lookup Customer By Last Name in CRM - Python Tkinter GUI Tutorial #33

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2024

ความคิดเห็น • 26

  • @Codemycom
    @Codemycom  4 ปีที่แล้ว +4

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My TH-cam Channel:
    bit.ly/2UFLKgj bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com
    Take $22 off with coupon code: youtube

  • @paulushimawan5196
    @paulushimawan5196 2 ปีที่แล้ว

    I was wondering why it is working perfectly although you misspelled "search" in "def search_now()". Turns out the button command was also misspelled into "seach_now" 😀
    Anyway, thank you, I learn a lot from you!

  • @kangsan2014
    @kangsan2014 3 ปีที่แล้ว

    Your video is excellent. When you search names and it comes up at the bottom, instead of it showing up as one line, can you wrap it at certain locations so that it is easier to read?

  • @parsabahrambeik4381
    @parsabahrambeik4381 4 ปีที่แล้ว +1

    Thank you very much for your video.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      You are welcome

  • @nishkalgupta2068
    @nishkalgupta2068 2 ปีที่แล้ว

    Hey, I wanted to know if there are multiple search fields(entry boxes) together and if the user fills in only few search fields, then how does mysql ignore the non filled fields and return the query. for example if there are 4 fields first_name, last_name, email and mobile entry boxes and the user only fills the first two then what query should we use in mysql to ignore email and mobile. It would be really useful if you can answer this as it is useful in my current project.

  • @ConceptCubes
    @ConceptCubes 2 ปีที่แล้ว

    #15:00 can we highlight the searched text Elder in the searched results below.

  • @storageaccountiii8917
    @storageaccountiii8917 2 ปีที่แล้ว

    When I tried to search it with uppercase it did not find. But I am using postgres, is it due to that?

    • @alakazellae-commerce9627
      @alakazellae-commerce9627 ปีที่แล้ว

      I know this is a year old. Keywords in SQL are case-insensitive for the most popular DBMSs. BUT, VARCHAR is case-sensitive in PostgreSQL.
      Typically a VARCHAR field is treated as case-sensitive in Postgres. Meaning that fieldname = 'FOO' and fieldname = 'foo' won't find any matches when the actual value is "FOO".

  • @bennysalim354
    @bennysalim354 4 ปีที่แล้ว

    why i got this error message?
    Traceback (most recent call last):
    File "C:\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
    File "C:\Workdata\Benny\setup", line 42, in search_now
    result = my_cursor.execute(sql, name)
    pyodbc.ProgrammingError: ('The SQL contains 0 parameter markers, but 1 parameters were supplied', 'HY000')
    Exception in Tkinter callback

  • @ntfcorreia
    @ntfcorreia 4 ปีที่แล้ว

    Hi! im new in code. So im using sqlite3 from previous videos. The def searched must different right? Can be this:
    searched = search_box.get()
    c.execute("SELECT * FROM information WHERE b_name = %s" + searched)
    result = c.fetchall()

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      sorry don’t know what you’re asking

    • @ntfcorreia
      @ntfcorreia 4 ปีที่แล้ว

      @@Codemycom dont worry! Just figure it out! Love the tutorials, keep it up!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      @@ntfcorreia ha good!

    • @ntfcorreia
      @ntfcorreia 3 ปีที่แล้ว

      @H_kailz hi! i assume you made exactly like the videos. So the sqlite code i wrote was this:
      conn = sqlite3.connect('information.db')
      c = conn.cursor()
      searched = search_box.get()
      name = (searched, )
      result = c.execute(sql, name)
      result = c.fetchall
      Hope that helps you

  • @slobodantajisic2762
    @slobodantajisic2762 4 ปีที่แล้ว +1

    Each time we want to access the base, we should establish a connection and then close it later. I think that would be the best practice.

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      Aren't I doing that?

    • @slobodantajisic2762
      @slobodantajisic2762 4 ปีที่แล้ว +1

      @@Codemycom
      No you're not. I think that each function that accesses the database needs to establish a connection and then close it. For example :
      def list_customers():
      list_customer_query = Tk()
      list_customer_query.title("List All Customers")
      list_customer_query.geometry("800x600")
      mydb = mysql.connector.connect(
      host="localhost",
      user="root",
      passwd="something",
      database="codemy"
      )
      # Create a cursor and initialize it
      my_cursor = mydb.cursor()
      # Query The Database
      my_cursor.execute("SELECT * FROM customers")
      results = my_cursor.fetchall()
      for index, result in enumerate(results):
      num = 0
      for item in result:
      lookup_label = Label(list_customer_query, text=item)
      lookup_label.grid(row=index, column=num)
      num += 1
      csv_button = Button(list_customer_query, text="Save to Excel", command=lambda: write_to_csv(results))
      csv_button.grid(row=index + 1, column=0)
      my_cursor.close()
      mydb.close()
      But ok. The tutorials are great. Thanks...

  • @drronyvincent
    @drronyvincent 3 ปีที่แล้ว

    How can we use Enter key to show search result???
    And how to show research result without even typing exact same spelling??

    • @errorhostnotfound1165
      @errorhostnotfound1165 3 ปีที่แล้ว

      import keyboard
      if keyboard.is_pressed('Enter'):
      code
      this might work for the first part of your question. For the other part, no idea.

    • @paulushimawan5196
      @paulushimawan5196 2 ปีที่แล้ว

      @@errorhostnotfound1165 excellent. Was also doing this in processing.js, but I just know in Python it is somewhat similar.

  • @billstrain1
    @billstrain1 4 ปีที่แล้ว

    How would I do a wild card search

  • @billstrain1
    @billstrain1 4 ปีที่แล้ว

    Forget last question. I changed the search to 'like' instead of =