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

  • Home
  • SEARCH
  • 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 7659041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:16:49+00:00 2026-05-31T13:16:49+00:00

What placeholders can I use with pymssql. I’m getting my values from the html

  • 0

What placeholders can I use with pymssql. I’m getting my values from the html query string so they are all of type string. Is this safe with regard to sql injection?

query = dictify_querystring(Response.QueryString)
employeedata = conn.execute_row("SELECT * FROM employees WHERE company_id=%s and name = %s", (query["id"], query["name"]))  

What mechanism is being used in this case to avoid injections?

There isn’t much in the way of documentation for pymssql…

Maybe there is a better python module I could use to interface with Sql Server 2005.

Thanks,

Barry

  • 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-05-31T13:16:50+00:00Added an answer on May 31, 2026 at 1:16 pm

    Regarding SQL injection, and not knowing exactly how that implementation works, I would say that’s not safe.

    Some simple steps to make it so:

    1. Change that query into a prepared statement (or make sure the implementation internally does so, but doesn’t seem like it).

    2. Make sure you use ‘ around your query arguments.

    3. Validate the expected type of your arguments (if request parameters that should be numeric are indeed numeric, etc).

    Mostly… number one is the key. Using prepared statements is the most important and probably easiest line of defense against SQL injection.

    Some ORM’s take care of some of these issues for you (notice the ample use of the word some), but I would advise making sure you know these problems and how to work around them before using an abstraction like an ORM.

    Sooner or later, you need to know what’s going on under those wonderful layers of time-saving.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use placeholders as seen in this example: cursor.execute ( UPDATE animal
// First, prepare the statement, using placeholders $query = SELECT * FROM tableName; $stmt
Given a slide how can one figure out if all the slide layout placeholders
Can I use placeholders in a prepared statement for the order by clause of
Is there a way to use variable length placeholders in an SQL query? Right
I'm attempting to use boost::format, where my formatting string is the HTML below. I
Using sprintf() how can I replace multiple placeholders in a string with one value?
I am using PHPs' strtr method to replace certain tokens/placeholders in a string. This
I have a dotx file which contains placeholders to be replaced with DB values
I have a Freemarker template which contains a bunch of placeholders for which values

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.