Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7883085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:26:24+00:00 2026-06-03T04:26:24+00:00

Hell guys just jumped in to python and i’m having a hard time figuring

  • 0

Hell guys just jumped in to python and i’m having a hard time figuring this out

I have 2 queries . . query1 and query2 now how can i tell
row = cursor.fetchone() that i am refering to query1 and not query2

cursor = conn.cursor()
query1  = cursor.execute("select * FROM spam")
query2  = cursor.execute("select * FROM eggs")
row = cursor.fetchone ()

thanks guys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:26:26+00:00Added an answer on June 3, 2026 at 4:26 am

    Once you perform the second query, the results from the first are gone. (The return value of execute isn’t useful.) The correct way to work with two queries simultaneously is to have two cursors:

    cursor1 = conn.cursor()
    cursor2 = conn.cursor()
    cursor1.execute("select * FROM spam")
    cursor2.execute("select * FROM eggs")
    cursor1.fetchone() #first result from query 1
    cursor2.fetchone() #first result from query 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hell All, So I have been facing this behavior for quite some time and
Hello guys i'm having one hell of a time trying to parse an xml
I'm having a hell of a time trying to figure out how to do
I am having a hell of a time with this problem: Using MPI, I
I'm having an absolute hell of a time trying to figure out how to
I am having a hell of a time trying to md5 hash this with
I'm having a hell of a time with this simple line of code and
I'm having one hell of a headache trying to figure this out for myself,
I'm having a hell of a time finding documentation which clearly explains how to
I'm having one hell of a time trying to get my databinding to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.