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 8543411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:17:42+00:00 2026-06-11T12:17:42+00:00

I am storing information about files that I read in from files in binary.

  • 0

I am storing information about files that I read in from files in binary. I am using mysql to store the information. One of the columns is the absolute path of the file. This code will run periodically so I want to check that this specific file hasn’t been parsed before.

I am trying to execute:

path = os.path.join(root,f)

sql = "SELECT * FROM %s WHERE Filepath = %s" % ("tntfiles", path)

But to no avail. I get an error saying: “1064, “You have an error in your SQL syntax”

I’ve tried doing the same query with ` around the path:

path = "`" + path + "`'"

but I get: “1064, “You have an error in your SQL syntax”

I’m not sure what I’m doing wring because I can execute a similar query with

"SELECT * FROM %s WHERE Id = %s" % ("tntfiles","1") 

and it works just fine.

Thanks

  • 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-11T12:17:44+00:00Added an answer on June 11, 2026 at 12:17 pm

    MySQL needs to have strings surrounded by ‘ or ” – so just change the code to

    "SELECT * FROM %s WHERE Filepath = '%s'" % ("tntfiles", path)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder that contains about 100 txt files with information in each
I'm currently attempting to read information about an object from the web.config file and
I'm building a WebApp in jsf 2.0 and it's about storing information and displaying
I have 2 tables - one storing user information (id, username, password) and the
Whats the recommended way for storing authentication information in iOS that could be easily
I am retrieving information from my database and storing it in a reader. The
My current project is to take information from an OleDbDatabase and .CSV files and
Introduction I've found plenty of information about the Too many open files exception on
I have a section of code that I need to remove from multiple files
Here is the Roo script that I am running. Using version spring-roo-1.2.2.RELEASE from the

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.