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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:20:03+00:00 2026-06-15T11:20:03+00:00

Hi hi am converting my MySQL code to MySQLi because it is more secure,

  • 0

Hi hi am converting my MySQL code to MySQLi because it is more secure, but AFAIK MySQLi is not more secure by itself.

I used the converter in the selected answer this topic:
Updating from MYSQL to MYSQLI

and the code is working, but now i don’t exactly know what to do, i know i have to prepare the querys but exactly where and how to prepare i don’t know…

For example if i have an INSERT query with 5 or more php variables is it ok? how do i do? all the examples i find is with one variable… and do i prepare in the line immediately before the query?

Am I being too confusing? I’m Sorry if this is very basic stuff but i am completely noob with this and all i want is some guidelines…

  • 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-15T11:20:05+00:00Added an answer on June 15, 2026 at 11:20 am

    Here’s an example of an INSERT query with multiple parameters.

    /* create a prepared statement */
    if ($stmt = $mysqli->prepare("INSERT INTO mytable (field1, field2, field3) VALUES(?, ?, ?)")) {
    
        /* bind parameters for markers */
        $stmt->bind_param("sss", $field1, $field2, $field3);
    
        /* execute query */
        $stmt->execute();
    
        /* close statement */
        $stmt->close();
    }
    

    As you can see $field1, $field2, and $field3 will be bound as strings (note the three s) and will replace the ? in the query.

    Bind param types:

    i – corresponding variable has type integer
    d – corresponding variable has type double
    s – corresponding variable has type string
    b – corresponding variable is a blob and will be sent in packets

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

Sidebar

Related Questions

I am converting some of my code that used ext/mysql ( mysql_*() functions) to
I found alot of question on stack about converting mysql to mssql, but i
i've been trying my hand at mysqli. using procedural mysql, the code displays the
I want to converting values from array before inserting in MySQL. I used the
I'm converting from MySQL to MySQLi and I noticed that if I am limiting
I am converting some of my code from the older mysql extension to the
I am connecting C to mysql and then creating a database . My code
ms-access is connecting to a local mysql database the following code returns an error:
What is the php script for converting a mysql table to text file? I
I am converting all my SQL Server queries to MySQL and my queries that

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.