#πŸ”’ Python mysql connector code

24 messages Β· Page 1 of 1 (latest)

fresh latch
#

ABC School is managing student data in student table in the school database. Write a code that connects to database school and displays the record of total number of students.
this is the question from one of my assignments how to solve it?

tribal dustBOT
#

@fresh latch

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fresh latch
#

@fossil anchor

#

this is the question

fossil anchor
fresh latch
#

wait ill sahre something

#

so i found this line online

#

@fossil anchor can u just tell me one thing

#

what does mycursor.fetchall do

#

thats all i need

fossil anchor
#

oh you're already using mysql connector

fresh latch
#

yea

fossil anchor
#

then forget about sqlalchemy

fresh latch
#

what does mycursor.fetchall() do

#

does it retrieve all the data from table?

fossil anchor
#

fetchall means fetch all. which means grab everything from that table

fresh latch
#

oh okay

#

thanks dude

#

i think i did it

#

Yep its working

#

Thanks dude

tribal dustBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.