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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:49:09+00:00 2026-06-18T08:49:09+00:00

I plan to use code below for adding records into MySql in a secure

  • 0

I plan to use code below for adding records into MySql in a secure way.
My questions:

  1. I always input my own articles by using admin page’s form.
    Since my mysql database and table are encoded in UTF-8, collation:
    utf8_unicode_ci; and all my web pages are charset=utf-8 then do I
    still need first sentence in function (sentence starts with
    mb_convert_encoding …)
  2. 2 – ) Is it possible for a web page viewer, his/her comment input
    into my textarea is not encoded in utf-8 despite my all encodings
    (web&mysql) aer set to utf-8
  3. Code below needs any improvement?

    function safe_input_into_mysql($safe_str)
    {

    $safe_str = mb_convert_encoding($safe_str, 'UTF-8', mb_detect_encoding($safe_str));

    $safe_str = mysqli_real_escape_string($dbc, $safe_str);

    return $safe_str;

    }

  • 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-18T08:49:10+00:00Added an answer on June 18, 2026 at 8:49 am

    In what way do you want the database records to be “secure”? Secure against what?

    For communication with a database, you should use parameterised queries. That means there will not be a security risk at the database level. It does not mean the stored data might not be dangerous if used elsewhere (for example, output as part of an HTML document) in an unguarded fashion.

    You mentioned that the table character set is UTF-8, but you don’t mention the connection character set. You should also make sure the connection character set is set appropriately.

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

Sidebar

Related Questions

The way I plan to use it is: At the seminar, have people send
we plan to use TIBCO EMS queues and TIBCO BW listeners on those queues
If I do a query (I plan to use SDS.P) against the global catalog,
Need an async I/O Processing Plan to use async I/O through aio* calls on
I am developing a web app for which I plan to use InnoDB. However
I'm looking for a a mouseover sound script (for button). I plan to use
I'm working on a document storage. Therefore I plan to use SqlServer 2012 with
I am using mod_perl for my web application. Currently, I plan to use a
We use scrum technique to plan for short development lifecycle. It is very common
I use Visual Studio .NET to develop a component named X_Component and I plan

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.